I'm a newb, trying to use if-else statements and brackets. I keep getting this error: sstream.cpp:45 error: expected primary-expression before "else"
" " expected ';' before "else"
Pretty sure it's got something to do with the brackets, but I don't know what's going wrong. Any help is greatly appreciated. Line with the error code (45) is designated by astericks.
Messed with the code a bit more, ended up getting the following error.
$ g++ sstream.cpp -o sstream.exe
sstream.cpp: In function `int main()':
sstream.cpp:43: error: expected primary-expression before "else"
sstream.cpp:43: error: expected `;' before "else"
Adding a closing } to line 45 with the else statement gives me 7 errors, all saying the same expected ';' before "else" at a bunch of different lines where I already have closing and opening brackets. Anyone got any ideas? Starting to slam my head against the wall here...
else if didn't work, but deleting the whole statement and rewriting it as a straight up if statement did. Weird stuff, but thanks for the help! Why did you say else if though?
Also, how could I make it so that any pin used other than 1111 would result in incorrect pin?