C语言中printf引号内容的换行方式
(2012-04-08 23:27:43)
标签:
cprintf换行it |
分类: C_Study |
printf函数中字符串参数的引号内容的两种换行方式:
第一种:
#include <stdio.h>
int
main()
{
printf("Hello,
\
//在此行的末尾加个反斜杆
world!\n");
//此行顶格,若加空格,则会被一并打印出来
return 0;
}
第二种:
#include <stdio.h>
int
main()
{
printf("Hello, "
"world\n");
//此种方式不需要顶格,能使代码更美观、易读
return 0;
}
第一种:
#include <stdio.h>
int
main()
{
world!\n");
}
第二种:
#include <stdio.h>
int
main()
{
}