Created
June 13, 2014 11:42
-
-
Save yamamaya/217ddb03ada591a01bf5 to your computer and use it in GitHub Desktop.
convert bare word to string literal
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
#define message NYA! | |
// Preprocessor magic! | |
#define _STRING(str) #str | |
#define STRING(str) _STRING(str) | |
int main(void) { | |
printf( "%s\n", STRING( message ) ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment