c++ 输出 变量名 字符串(zz.is2120.BG57IV3)
#define SHOW(a) std::cout << #a << ": " << (a) << std::endl
// ...
int i = 2;
SHOW (i);
//z 2013-01-29 16:19:23 IS2120@BG57IV3.T739790998 .K[T104,L1428,R47,V1454]Hey, I like that macro. If you don't mind, I'm going to improve it just a little:
#define TO_STREAM(stream,variable) (stream) <<#variable": "<<(variable)
Here's an interesting (?) variation:
|
|
@IS2120#CNBLOGS.T2169364049[T1,L65,R1,V259]:备忘
$ € ₤ ₭ ₪ ₩ ₮ ₦ ₱ ฿ ₡ ₫ ﷼ ¥ ﷼ ₫ ₡ ฿ ₱ ₦ ₮ ₩ ₪ ₭ ₤ € $