Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-std=c99 -Wall -Wextra -Wpedantic -Wshadow
- #include <stdio.h>
- #include <stdlib.h>
- #define LIMIT_NUM 32
- #define STRINGIZER2(x) #x
- #define STRINGIZER(x) STRINGIZER2(x)
- int main()
- {
- unsigned int var = LIMIT_NUM;
- printf ( "%d\n", var );
- int arr[LIMIT_NUM] = {0};
- printf( "%ld\n", sizeof arr / sizeof *arr );
- char *str = "LIMIT: " STRINGIZER(LIMIT_NUM);
- printf ("%s\n", str );
- return 0;
- }
- /*
- output:
- 32
- 32
- LIMIT: 32
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement