+ 1
In C++ how to use " or ' under cout<<" ";
Like py we use \' or \" under print(" ") to print ' or " on output screen what's in C++ for this ?
3 Respuestas
+ 4
Almost the same, except single quotes doesn't need escaping in a string or constant char pointer.
cout << "\"ok boss\"""" << " it's time to eat";
+ 4
Slash / doesn't form an escaped character, \ does ...
"\n" -> line break (an escaped character).
"/n" -> regular string.
+ 1
Yes it's my mistake I checked it before post question but I use / in place of \