我有这样的C代码:
#include<stdio.h>
int main()
{
printf("Hey this is my first hello world \r");
return 0;
}
我尝试使用转义序列\r
,作为一次实验。在运行代码时,输出结果如下:
o world
为什么会这样,\r
的作用是什么?如果我在在线编译器上运行相同的代码,输出结果将是:Hey this is my first hello world
为什么在线编译器会忽略\r
并产生不同的输出结果?