ASC C之后引入的一个特性是,相邻的字符可以被自动连接
1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 printf("abcd" 6 "efg\n"); 7 8 char* var[] = { 9 "adf", 10 "def" 11 "ghi", 12 }; 13 14 printf("size of var is: %d\n", sizeof(var)/sizeof(var[0])); 15 16 for(size_t sz = 0; sz < sizeof(var)/sizeof(var[0]); sz++) 17 cout << var[sz] << endl; 18 19 return 0; 20 }
$ ./a.exe abcdefg size of var is: 2 adf defghi
时间: 2025-01-10 11:50:44