Skip to content

Instantly share code, notes, and snippets.

@yamamaya
Created June 13, 2014 11:42
Show Gist options
  • Save yamamaya/217ddb03ada591a01bf5 to your computer and use it in GitHub Desktop.
Save yamamaya/217ddb03ada591a01bf5 to your computer and use it in GitHub Desktop.
convert bare word to string literal
#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