Skip to content

Instantly share code, notes, and snippets.

@zenubis
Created May 15, 2014 03:08
Show Gist options
  • Save zenubis/585f0747923c78688bf3 to your computer and use it in GitHub Desktop.
Save zenubis/585f0747923c78688bf3 to your computer and use it in GitHub Desktop.
A macro to make literal string out of everything you type into it
// double macro expansion to make int to const string
// usage, printf("number of lines in this file " MAKE_STRING(42));
#define S(x) #x
#define MAKE_STRING(x) S(x)
#define STR__LINE__ MAKE_STRING(__LINE__) // __LINE__ as a string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment