+ 2
With \n in the quotations how can you actually print â\nâ without it creating a new line? C++
Sorry for the dumb question⊠just finished lesson 3 of C++ and am wondering if itâs possible to output the text â\nâ and not create a new line. Would you need to join them separately or is there another way to tell your code to treat \n as a string and not a new line? And I apologize if this isnât the right place to ask⊠the Q/A on this lesson isnât active, and I need bits for the code coaches. đ this is also just a theoretical question. Thanks!
1 Answer
+ 3
For \n i have a simple ans
cout<<"\\"<<"n";
cout<<"\\n"; also works