Ok, im getting very tired of my borland compiler....i followed my book to the T in this code, but it still doesn't work...with the following code:
Code:
#include <iostream>
using namespace std;
bool loggedIn=0;
int main() {
enum student (00001,00002,00003,);
enum student id;
do {
cin>>id;
switch (id) {
case 0:
loggedIn=1;
break;
case 1:
loggedIn=1;
break;
case 2:
loggedIn=1;
break;
default:
break;
};
} while (loggedIn=0);
cout<<id;
return 0;
}
i recieve the error: declaration terminated incorrectly in function main()
it is at the line that declares the enumerator (not enum student id...what in the heck is wrong here?
note: using curly braces {} instead of () or [] makes my compiler put out unexpected '}' errors at multiple lines...so that's not the problem...