When to include quotation marks for cout

" " means space. For example when you want to print 2 string variables separated with space :

std::string str1 = "Hello";
std::string str2 = "World";

std::cout << str1 <<" "<< str2;

Output :

Hello World

If you are asking about " in cout, it is used to print any text inside the double quotes.
std::cout << "Any Text";

Remember the space inside " " also a text.

Browse More Popular Posts

Leave a Comment