码迷,mamicode.com
首页 > 其他好文 > 详细

printf的使用

时间:2014-08-16 09:43:40      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   使用   os   io   for   ar   

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

 

printf的使用,布布扣,bubuko.com

printf的使用

标签:style   blog   color   使用   os   io   for   ar   

原文地址:http://www.cnblogs.com/dracohan/p/3915997.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!