-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start mentionning macros arguments expansion rules
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <stdio.h> // printf | ||
|
||
#define STRINGIZE(ARG) # ARG | ||
|
||
int main(int arg_count, char** arg_values) | ||
{ | ||
printf("Line as integer: %i\n", __LINE__); | ||
printf("Line as string: %s\n", STRINGIZE(__LINE__)); | ||
printf("Concatenated: " STRINGIZE(__LINE__) "\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> // printf | ||
|
||
#define STRINGIZE(ARG) # ARG | ||
#define STRINGIZE_WRAPPER(ARG) STRINGIZE(ARG) | ||
|
||
int main(int arg_count, char** arg_values) | ||
{ | ||
printf("Line as integer: %i\n", __LINE__); | ||
printf("Line as string: %s\n", STRINGIZE_WRAPPER(__LINE__)); | ||
printf("Concatenated: " STRINGIZE_WRAPPER(__LINE__) "\n"); | ||
} |