Carriage return in C?

前端 未结 3 1486
执念已碎
执念已碎 2020-12-07 16:43

Output of Following program is : hai

I didn\'t get how the \\r carriage return works in this program and in real can any one help me out

3条回答
  •  执念已碎
    2020-12-07 17:26

    Program prints ab, goes back one character and prints si overwriting the b resulting asi. Carriage return returns the caret to the first column of the current line. That means the ha will be printed over as and the result is hai

提交回复
热议问题