Jul 14, 2004 #1 fugigoose Programmer Joined Jun 20, 2001 Messages 241 Location 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.
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.
Jul 14, 2004 #2 xwb Programmer Joined Jul 11, 2002 Messages 6,828 Location GB If ASCII, try fs << (char) 0x22; I don't know about EBCDIC. Upvote 0 Downvote
Jul 14, 2004 1 #3 ArkM IS-IT--Management Joined Oct 21, 2002 Messages 1,819 Location RU Code: fs << "\""; C/C++ escape sequence for quotation mark... Upvote 0 Downvote
Jul 14, 2004 #4 xwb Programmer Joined Jul 11, 2002 Messages 6,828 Location GB Or even fs << '"'; Since it is just a single character. Upvote 0 Downvote
Jul 15, 2004 #5 ArkM IS-IT--Management Joined Oct 21, 2002 Messages 1,819 Location RU With escape sign (in strict language rules: Code: cout << '\"'; Upvote 0 Downvote