Discussion:
Hangman output
(too old to reply)
Bhatia Jayesh
2004-01-18 05:26:46 UTC
Permalink
At the end of hangman game, we are asked to display { The word was
"word"}.
Doing this gives an error, I guess because double quotation marks have a
meaning in printf.
I thought of using single quotation marks instead, but wouldn't
that
result in autocheck failure ?
Mehes Andrew F J
2004-01-18 18:12:28 UTC
Permalink
Try using \", that should do it.
Post by Bhatia Jayesh
At the end of hangman game, we are asked to display { The word was
"word"}.
Doing this gives an error, I guess because double quotation marks have a
meaning in printf.
I thought of using single quotation marks instead, but wouldn't
that
result in autocheck failure ?
Moayad Fahim Ali
2004-01-18 19:06:14 UTC
Permalink
If I correctly understand your question, you should use the escape
sequence for quotes.

Example: printf("This is a \"test\"\n");

Prints: This is a "test"
Post by Bhatia Jayesh
At the end of hangman game, we are asked to display { The word was
"word"}.
Doing this gives an error, I guess because double quotation marks have a
meaning in printf.
I thought of using single quotation marks instead, but wouldn't
that
result in autocheck failure ?
Bhatia Jayesh
2004-01-18 20:13:43 UTC
Permalink
Thanks
That works...
Post by Moayad Fahim Ali
If I correctly understand your question, you should use the escape
sequence for quotes.
Example: printf("This is a \"test\"\n");
Prints: This is a "test"
Post by Bhatia Jayesh
At the end of hangman game, we are asked to display { The word was
"word"}.
Doing this gives an error, I guess because double quotation marks have a
meaning in printf.
I thought of using single quotation marks instead, but wouldn't
that
result in autocheck failure ?
Loading...