-   Programming (
-   -   how to use quotation marks in c++ stream (

knobby67 07-27-2011 11:35 AM

how to use quotation marks in c++ stream
Hi all
I'm writing some code to speed up some code writing, basically it produces some code I use in every project. I produce the outputs with fstream filestr;, open a file and write to some data to it. However some code has quote marks that I need to output, however I can't use quote marks.
filestr<<"#include "Header.h""<<endl;
I get round this with some awful filestr.put ('"');
However I'm sure there must be a straight forward way to do this. Can anyone advise?
Thanks :)

Nylex 07-27-2011 11:40 AM

Escape them: "#include \"Header.h\"".

knobby67 07-28-2011 02:04 AM


Nylex 07-28-2011 02:07 AM

Please mark your thread as solved (look under Thread Tools at the top) if your question has been answered.

All times are GMT -5. The time now is 05:55 AM.