By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

How to print hello world in double quote in c ?

P: 1
How to print hello world in double quote in c ?
Sep 24 '15 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
You have to use an escape sequence.
The escape sequence is a backslash (\). The \ tells the compiler that the character behind the backslash is a code for something else.

So \" says that the " is not part of the syntax but is data:

Expand|Select|Wrap|Line Numbers
  1. printf("\"Hello world!\""\n);
See also the \n. The compiler does not see this as a \ and an n but a code. In this case \n is the code for a newline on the screen.

There are various escape sequence characters that you should review.
Sep 24 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.