Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
battle_c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
이장원
battle_c
Commits
3f4c1aba
Commit
3f4c1aba
authored
4 years ago
by
이장원
Browse files
Options
Downloads
Patches
Plain Diff
C Preprocessor, Multiple file compile
parent
373d34ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
8.5/README.md
+13
-13
13 additions, 13 deletions
8.5/README.md
with
13 additions
and
13 deletions
8.5/README.md
+
13
−
13
View file @
3f4c1aba
...
@@ -44,37 +44,37 @@ b = f(20+13) // b = 1089
...
@@ -44,37 +44,37 @@ b = f(20+13) // b = 1089
### etc.
### etc.
*
`
#pragma once
`
*
#pragma once
#pragma once를 사용하여 여러번 include하는 것을 방지할 수 있다.
`
#pragma once
`
를 사용하여 여러번 include하는 것을 방지할 수 있다.
*
Token stringification
*
Token stringification
`#define <identifier>(<parameter>) #parameter`
`#define <identifier>(<parameter>) #parameter`
#연산자는 token을 문자열 상수로 변환한다.
#연산자는 token을 문자열 상수로 변환한다.
*
Token concatenation
*
Token concatenation
`#define <identifier>(<parameter>) parameter##string`
`#define <identifier>(<parameter>) parameter##string`
##연산자는 두 token을 하나로 연결하여 변환한다.
##연산자는 두 token을 하나로 연결하여 변환한다.
*
Debuging macros
*
Debuging macros
디버깅을 하면서 어느 부분에서 에러가 났는 지 알려준다.
디버깅을 하면서 어느 부분에서 에러가 났는 지 알려준다.
* __FILE\_\_
* __FILE\_\_
에러가 발생한 파일 경로
에러가 발생한 파일 경로
* __LINE\_\_
* __LINE\_\_
에러가 발생한 라인
에러가 발생한 라인
* __FUNCTION\_\_
* __FUNCTION\_\_
에러가 발생한 함수
에러가 발생한 함수
# Multiple file compile
# Multiple file compile
*
func.h
*
func.h
```
c
```
#define SQAURE(a) ((a)*(a))
#define SQAURE(a) ((a)*(a))
extern int func(int a);
extern int func(int a);
```
```
*
func.c
*
func.c
```
c
```
#include "func.h"
#include "func.h"
int func(int a)
int func(int a)
...
@@ -84,7 +84,7 @@ int func(int a)
...
@@ -84,7 +84,7 @@ int func(int a)
```
```
*
main.c
*
main.c
```
c
```
#include <stdio.h>
#include <stdio.h>
#include "func.h"
#include "func.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment