My code isnt working!

Help! My code says: error expected ')' before '{' token on line 5. On line 13 it says error: statement cannot resolve address of overloaded function.

#include <iostream>
using namespace std;
int main()
{
for(int i = 0; i < 12; i++{
switch(1){

case 0: cout << "hi"; break;
case 1: cout << "there"; break;

}
}
endl;
return 0;
}

If I try to fix it, it just makes more errors!
Last edited on
error expected ')' before '{' token on line 5.


That's pretty self explanitory. You're missing a ')' before the '{' on line 5.

As for the other error... you're just doing endl; which is nonsense. You probably meant to do cout << endl;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;
int main()
{
for(int i = 0; i < 12; i++)
{
switch(1){

case 0: cout << "hi"; break;
case 1: cout << "there"; break;

}
}
cout << endl;
return 0;
}
I can't believe I didn't see those errors! Thx!
Topic archived. No new replies allowed.