Created
          May 15, 2014 03:08 
        
      - 
      
- 
        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
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | // 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