小编Cin*_*rse的帖子

为什么 printf 语句不继续到下一行?

考虑这个程序:

#include <stdio.h>

int main()
{
    int a;
    a = 16;
  
    printf("This is the first line
    this is the second line
    ");
}
Run Code Online (Sandbox Code Playgroud)

为什么这个程序会抛出错误?为什么不能编译成功并显示输出:


This is the first line
this is the second line
|
Run Code Online (Sandbox Code Playgroud)

符号“|” 这里表示光标闪烁,表示光标移到了下一个,暗示“第二行”后面出现了 STDOUT 中的 '\n' 字符。

                                              .
Run Code Online (Sandbox Code Playgroud)

c syntax printf semantics

2
推荐指数
1
解决办法
194
查看次数

标签 统计

c ×1

printf ×1

semantics ×1

syntax ×1