printf \ n给出一个奇怪的输出

时间:2014-01-08 02:56:00

标签: terminal stdout printf

我试图制作一个需要打印这样的程序。

printf("Hello");
printf("\nYou are not allowed to do [%s]\n",string);
fflush(stdout);

不知何故,我从终端获得的显示很奇怪。

fikrie@hello:Hello
fikrie@hello:whoami
fikrie@hello:
                        You are not allowed to do [whoami]
                                   | <----//Then the user input print from here

我在这里失踪的是什么?它有与printf有关的东西吗?还是因为终端?我在CentOS 6.2 64位上测试它。

0 个答案:

没有答案