Error about too many characters in char literal

Status
Not open for further replies.

aewarnick

Senior Contributor
Joined
Jan 29, 2003
Messages
1,031
char[]c = new char[]{'/', '\'};
Too many characters in character literal. What is wrong! This is frustrating!
 
Microsoft could probably have thought of a better error message.
That problem was the single backslash \ - escape character. To indicate a backslash you need \\.
 
It's hardly Microsoft's fault you failed to remember that C# has escape characters in strings :)
 
Status
Not open for further replies.
Back
Top