Could you please tell me how can one escape an apostrophe.
I need it to process non apostrophe characters through file operations so when I encounter an apostrophe('
) I can't just give ch!='''
. It doesn't work. Could you please tell me the right format. Thank you..:)
Use \'
, for example:
if ( ch != '\'' )
\'
is an escape sequence for the apostrophe.
Google for "escape sequence" to know more about it.
You can escape a single quote as
'\''
for example
while(*p && *p != '\'') p++;
This is an escape sequence; the backslash tells the compiler that following '
normal character, and not as one of the single quotes that you surround a character with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With