I'm trying to declare a simple array with a long list so that later in my code I can identify the "badChar"s in my input, but every time I try to compile I get the "newline in constant" error. I read that this usually happens when someone forgets the closing " or ', but I checked carefully and each symbol has its own pair of single quotes with no extras.
Does this have something to do with the symbols I'm trying to use? How can I get rid of this error?
Also, I know that the compiler was having issues when '[' and ']' were part of the array so I took them out, but if anyone can let me know of a way to include them I'd really appreciate it.
\ is used in escape sequences like \n, \t, etc. In your code it will think that \' should be treated as one character. For that reason you need to write \\ to mean the \ character.
Oh! It's working now even though it was giving me errors about the brackets before. I must have made some typo earlier or something. Thanks for the help!