LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-27-2011, 11:35 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 536

Rep: Reputation: 42
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.
EG
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
 
Old 07-27-2011, 11:40 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Escape them: "#include \"Header.h\"".
 
1 members found this post helpful.
Old 07-28-2011, 02:04 AM   #3
knobby67
Member
 
Registered: Mar 2006
Posts: 536

Original Poster
Rep: Reputation: 42
Thanks!
 
Old 07-28-2011, 02:07 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can not input double quotation marks(invalid quotation key) wangzhilife Linux - Hardware 2 09-18-2009 06:44 AM
nested `` quotation marks deathalele Programming 2 03-16-2009 01:31 PM
Execvp With Quotation Marks amitbern Programming 10 11-25-2005 10:28 AM
no quotation marks jdoe9898 Linux - Newbie 1 10-12-2005 03:07 AM
Quotation marks and strings - in C lazyuser Programming 5 01-25-2005 08:14 AM


All times are GMT -5. The time now is 08:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration