+ 1
Can anyone help me i need help what is "/r" in c++ am confused
4 Answers
+ 8
Sonic Oh yes I miss-typed
+ 7
/r is an escape sequence which means Carriage Return.
It takes cursor to the start of the current line.
cout << "COMPUTER/rSCIENCE";
What it does is first it will print COMPUTER to the console then it will take cursor back to the beginning of the current line and will print SCIENCE. So the output will be like this:
SCIENCEER
+ 5
If you're talking about \r, it's a carriage return and will jump back to the beginning of the line (e.g. in console output, if supported). It's similar to \n which jumps to a new line.
+ 4
HINDUSTANI MOBILE GAMER GURU do you mean '\r'? See Anna's answer. It means carriage return. nAutAxH AhmAd 's example is good but it should be \r and not /r.