hello, I'm currently writing a program to write a website easier, but i don't know, how output " to a file? thank you very much for help

Recommended Answers

Wow, how vague. I'm assuming you have a string literal and want to put a double quote inside of it. In that case you escape it with a backslash:

cout<<"I'm a \"quoted\" string\n";

With character literals the escape is not needed:

cout<<"I'm a "<<'"'<<"quoted"<<'"'<<" string\n";
Jump to Post

All 2 Replies

Wow, how vague. I'm assuming you have a string literal and want to put a double quote inside of it. In that case you escape it with a backslash:

cout<<"I'm a \"quoted\" string\n";

With character literals the escape is not needed:

cout<<"I'm a "<<'"'<<"quoted"<<'"'<<" string\n";

Thanks man :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.