Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Quotations in character strings

This topic is 5149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Escape the double quotes inside the string by putting a backslash directly in front of them.

Edit: FIRST POST!!! Oh... crap.

[edited by - bobstevens on April 15, 2004 1:24:14 PM]

Share this post


Link to post
Share on other sites
Use a slash before the quotes you want to be output:

printf("\"abc\"");

OK, sorry, just kidding, I realize 3 people have already said that.

Just for interest sake, you can also do:

printf("%cabc%c", '"', '"'); // using quote characters


or

printf("%cabc%c", 0x22, 0x22); // using ASCII codes for the quote character





[edited by - BriTeg on April 15, 2004 1:36:07 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!