ASC C之后引入的一个特性是,相邻的字符可以被自动连接
/* printf.cc
* 2014/09/02 update
*/
#include <iostream>
using namespace std; int main() {
printf("abcd"
"efg\n"); char* var[] = {
"adf",
"def" //没有逗号,故自动连接在一起
"ghi",
}; //sizeof(var)为8
//sizeof(var[0])为4
printf("size of var is: %d\n", sizeof(var)/sizeof(var[])); for(size_t sz = ; sz < sizeof(var)/sizeof(var[]); sz++)
cout << var[sz] << endl; int p = ;
size_t apple = sizeof(int) * p;
printf("apple is: %d\n", apple); int q = ;
int res = p+++q;
printf("res is: %d\n", res); struct pig_id {
unsigned int a;
};
return ;
}
$ ./a.exe
abcdefg
size of var is:
adf
defghi
apple is:
res is: