Created
June 19, 2013 07:11
-
-
Save glass5er/5812226 to your computer and use it in GitHub Desktop.
to stringize arguments in macro, just prepend '#'
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
//-- to stringize arguments in macro, just prepend '#' | |
#define SET_STR(name,x) string name(#name); cout << name << " = " << x << endl; | |
int main(int argc, char const* argv[]) | |
{ | |
SET_STR(hoge,0); | |
SET_STR(fuga,550.5); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment