#include <iostream> #include <fstream> #include <string> #include <stdio.h> using namespace std; #define H1 123 #define SB(x) #x //translate to a string #define BB(x) U##x //produce a new symbol #define CB(x) #@x //make the last to a char void main() { int x = H1; //cout<<x<<endl; ofstream fout("1.txt"); fout<<x<<endl; fout<<"1234"<<endl; fout.close(); FILE* fp = fopen("2.txt","w"); fwrite(&x,4,1,fp); fprintf(fp,"%d",x); fclose(fp); string str = SB(123); std::cout<<str<<endl; int BB(1); U1 = 100; cout<<U1<<endl; char b = CB(14c2); }
原文地址:http://blog.csdn.net/ddupd/article/details/38590187