I have a title that is read in from the keyboard. I need to put it in quotation marks but i dont know how to do that...for instance, my program asks the user to put in a movie title and they input the title. Then i have to display the title to the screen, but I want to put quotation marks around it. How can this be done?
cassie_sanford
1
Junior Poster in Training
Recommended Answers
Jump to PostI have a title that is read in from the keyboard. I need to put it in quotation marks but i dont know how to do that...for instance, my program asks the user to put in a movie title and they input the title. Then i have to display the …
Jump to Postthis one?..
... cout << "\\Movie Name: " << setw(22) << movieTitle<<"\\" << endl; ... cout << "Movie Name: \\ " << setw(22) << movieTitle <<"\\"<< endl; ...
You are escaping the escape character, not the quotes here.
Jump to Postwouldnt the "\\" after "character" make the rest a comment? or is it different because it is "\" and not "/" ?
First answer: when in doubt, try it and see! It's the best way to learn. Second answer: yes, '/' and '\' are different characters. // denotes a comment, …
All 9 Replies
VernonDozier
2,218
Posting Expert
Featured Poster
cassie_sanford
1
Junior Poster in Training
cikara21
37
Posting Whiz
VernonDozier
2,218
Posting Expert
Featured Poster
VernonDozier
2,218
Posting Expert
Featured Poster
cikara21
commented:
yep..sorry..
+1
cikara21
37
Posting Whiz
Bladtman242
8
Junior Poster
VernonDozier
2,218
Posting Expert
Featured Poster
Comatose
commented:
Beat me to it!
+10
Comatose
290
Taboo Programmer
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.