Hello all;
Having a brain fart here.
I want to check if a char is == to an ' or not.
the statement if(char == ''') does not work bc the compiler sees the second ' as the end and the third as erroneous. Sooo....
how can I test for this condition
Hello all;
Having a brain fart here.
I want to check if a char is == to an ' or not.
the statement if(char == ''') does not work bc the compiler sees the second ' as the end and the third as erroneous. Sooo....
how can I test for this condition
Escape sequences.
Use the escape sequence for a single quote ( \' ) inside your quotes.
Code:if (x == '\'') ...
Last edited by Decrypt; 06-30-2006 at 07:33 AM.
There is a difference between tedious and difficult.
escape with a backslash, e.g. '\''
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Use a \
Code:'\''
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.