Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

why is this a compile error? else if(c=='\') return ~some integer~ while this is legal else if(c=='\\') return 24;

OpenStudy (rsmith6559):

The backslash has special properties. It's used to "escape" characters, continue lines and set a character's numerical value. In this case, the compile error is happening because the backslash basically has no argument. The second form, with two backslashes, the first backslash escapes the special properties of the second backslash so the second is evaluated as the backslash character. Meta-characters actually do make sense, eventually.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!