Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a " to a file 1

Status
Not open for further replies.

fugigoose

Programmer
Jun 20, 2001
241
US
How do I write a " into a file? Obviously the compiler doesn't like:

fs<<";

Is there a thing like \n that stands for a ". I thought i remember seeing it somewhere. If not maybe a decimal to ascii conversion function?

Thanx.
 
If ASCII, try

fs << (char) 0x22;

I don't know about EBCDIC.
 
Code:
fs << "\"";
C/C++ escape sequence for quotation mark...
 
Or even

fs << '"';

Since it is just a single character.
 
With escape sign (in strict language rules;):
Code:
cout << '\"';
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top