Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main()
- {
- printf("%dn", MARCO);
- // printf("%sn", MARCO);
- }
- gcc -D MARCO=12345 test.c
- gcc -D MARCO=abcde test.c
- error: ‘abcde’ undeclared (first use in this function)
- gcc -DMARCO='"abcde"' test.c
- #include <stdio.h>
- #define STRINGIFY(x) #x
- #define MACRO(x) STRINGIFY(x)
- int main(void)
- {
- printf("%sn", MACRO(MARCO));
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement