在xcode下写C,使用语句: printf("a\rbb");
\r不是回到行首的意思吗?理论上应该输出bb (因为回到行首,bb把a覆盖掉)
但实际上输出的是:
a
bb (编译器吧\r 等同于 \n ???)
如何解决这个问题?
PHPz2017-04-17 15:02:05
This should be related to the system.
Some systems use rn
to indicate retracement and line break;
Some systems use n
to achieve retracement and line break;
I guess you just learned Programming, there is no need to worry about these (you may rarely use these in the future).
You can try using the gcc
compiler in the command line. Mac should be configured.
If it doesn’t work, There is no need to worry. You can skip this question directly.
迷茫2017-04-17 15:02:05
Then try n
and see what the effect is. By the way, what version of OS X
is yours