0
Why ist like that [ cout << "Hello world! \n";] and not like that [cout << "Hello world!" \n;
5 Respostas
+ 7
Because "\n" is outside quotes and considered as variable...
+ 6
You can do : cout<<"Hello world!"<<"\n";
+ 1
but (\n) is inside of quotes???
+ 1
Mmm.... its in quotes not like (endl) okay thanks
0
the backslash "\" is actually an escape sequence. it is used to print out special characters in a string. For example if you want to print out " instead of actually closing the tag, you can type \". and therefore that is why \n has to be within the double quotes because the back slash is specially for printing special characters :)