A question of shortcuts | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

A question of shortcuts

What does "\r" do in c++?

30th Dec 2020, 5:07 AM
Mohammad Al_Ayoubi
Mohammad Al_Ayoubi - avatar
1 Resposta
+ 4
Mohammad Al_Ayoubi \r isĀ a carriage return character; it tells your terminal emulator to move the cursor at the start of the line. The cursorĀ isĀ the position where the next charactersĀ willĀ be rendered. So, printing a \rĀ allows to override the current line of the terminal emulator.. Read this : https://stackoverflow.com/questions/7372918/whats-the-use-of-r-escape-sequence#:~:text=%5Cr%20is%20a%20carriage%20return,line%20of%20the%20terminal%20emulator.
30th Dec 2020, 5:14 AM
Alphin K Sajan
Alphin K Sajan - avatar