So I want to check if someone enters: \n
('\'
and then 'n'
) from the keyboard to a string, so I'm doing something like this:
if ( ((str[i] == '\') && (str[i+1] == 'n')) ) {
//...
}
However this doesn't work because it recognizes \
as an escape character and the whole thing breaks.
Any better way to do this ?