+ 1

What is the opposite of endl or /n ?

13th Dec 2016, 4:46 AM
Dharm Vashisth
Dharm Vashisth - avatar
6 Respuestas
0
There is no much difference but here goes this logic. I use "endl" to create a new line when my cout prints an initialized or assigned variable at the end of cout statement.. example:- int x = 6; cout << x << endl; I use "\n" to create a new line when i know my cout prints a string that is not initialized at then end of cout statement. example:- int age = 12; cout << "I am " << age << " years old.\n";
13th Dec 2016, 6:33 AM
Franky BrainBox
Franky BrainBox - avatar
0
I mean to know the keyward to go back to one line before. eg endl is used to go to next line but can we go back to previous line also?
13th Dec 2016, 6:35 AM
Dharm Vashisth
Dharm Vashisth - avatar
0
\b
13th Dec 2016, 6:37 AM
manish rawat
manish rawat - avatar
0
what may be the opposite of space.
13th Dec 2016, 6:38 AM
Dharm Vashisth
Dharm Vashisth - avatar
0
oops ya u r right its opposite of space
13th Dec 2016, 6:38 AM
manish rawat
manish rawat - avatar
0
my bad, I assumed your meaning of opposite was "difference between". well. I think carriage return might do the trick \r. but i am not to sure of your question.
13th Dec 2016, 6:41 AM
Franky BrainBox
Franky BrainBox - avatar