Skip to content
Sign UpLog In
Profile icon

Eric Hofmann

@EricHofmann11
Repls
Community
EricHofmann11
EricHofmann11
shared a Post
2 years ago
expected expression error in c++
I am trying to create a program that will simply do calculations. However, when I try to prevent the user from inputting '\' instead of '/'. I get the
SixBeeps
SixBeeps
The backslash is used for escaping characters in most languages. If you want to enter a backslash character in a string, you have to escape it (effectively escaping the thing that's used for escaping): printf("\\"); // This outputs one backslash `2 years ago