im trying test macro our teacher gave , reason keep getting error messages. know why? can't seem figure out.
#include <iostream> #include <string> #define die(errmsg) {cerr << errmsg << endl; exit(1);} using namespace std; int main() { int x; for(;;) { cout <<"how you: " <endl; cout <<"1) good\n"; cout <<"2) bad\n"; cin >> x; if(x != 1 || x != 2) die("invalid input"); } return(0); }
check loop:
for(;;) { cout << "how you: " < endl; } you're missing < before std::endl
for(;;) { cout << "how you: " << endl; }
Comments
Post a Comment