main.cpp: In function 'int MathOp_C(int)':
main.cpp:34:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
while (guess = (x*y))
^
main.cpp: In function 'void Outstatment(int)':
main.cpp:109:4: error: case label not within a switch statement
default: cout<< " what it this ?" <<endl;
^
main.cpp: In function 'int main()':
main.cpp:178:21: error: 'MathOp_A' was not declared in this scope
MathOp_A (level);
^
main.cpp:182:21: error: 'MathOp_B' was not declared in this scope
MathOp_B (level);
^
main.cpp:190:21: error: 'MathOp_D' was not declared in this scope
MathOp_D (level);
^
main.cpp:208:5: error: expected ';' before 'Outstatment'
Outstatment(op);
^
main.cpp:231:1: error: case label ''n'' not within a switch statement
case 'n':
^
main.cpp:235:2: error: case label not within a switch statement
default: cout<< "okay bye."<<endl;
^
main.cpp:238:5: error: case label not within a switch statement
default: cout<<"hahha"<<endl;
^
main.cpp:240:3: error: expected 'while' before '}' token
}while (play!=0)
^
main.cpp:240:3: error: expected '(' before '}' token
main.cpp:240:3: error: expected primary-expression before '}' token
main.cpp:240:3: error: expected ')' before '}' token
main.cpp:240:3: error: expected ';' before '}' token
main.cpp:123:14: warning: unused variable 'a' [-Wunused-variable]
signed int a;
^
main.cpp: At global scope:
main.cpp:240:4: error: expected unqualified-id before 'while'
}while (play!=0)
^
main.cpp:242:5: error: expected unqualified-id before 'return'
return 0;
^
main.cpp:243:1: error: expected declaration before '}' token
}
^ |
Let's take this one at a time.
main.cpp:34:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
while (guess = (x*y))
^ |
You probably meant
while (guess == (x*y))
here.
main.cpp: In function 'void Outstatment(int)':
main.cpp:109:4: error: case label not within a switch statement
default: cout<< " what it this ?" <<endl;
^ |
The indentation here is really bad, so it's hard to see, but your
default:
case is outside of your
switch
statement.
You probably just misplaced/added an extra } or something.
main.cpp: In function 'int main()':
main.cpp:178:21: error: 'MathOp_A' was not declared in this scope
MathOp_A (level);
^
main.cpp:182:21: error: 'MathOp_B' was not declared in this scope
MathOp_B (level);
^
main.cpp:190:21: error: 'MathOp_D' was not declared in this scope
MathOp_D (level);
^ |
I suppose you probably have these functions defined in your code, but you deleted them in order to save space when you posted it.
main.cpp:208:5: error: expected ';' before 'Outstatment'
Outstatment(op);
^ |
You missed a semicolon at the end of your
while (level != 0)
(line 198).
main.cpp:231:1: error: case label ''n'' not within a switch statement
case 'n':
^
main.cpp:235:2: error: case label not within a switch statement
default: cout<< "okay bye."<<endl;
^
main.cpp:238:5: error: case label not within a switch statement
default: cout<<"hahha"<<endl;
^ |
Once again, these
case
values are outside of your
switch
.
In this case, the first
default:
case is actually
inside your
case 'n':
block!
main.cpp:240:3: error: expected 'while' before '}' token
}while (play!=0)
^
main.cpp:240:3: error: expected '(' before '}' token
main.cpp:240:3: error: expected primary-expression before '}' token
main.cpp:240:3: error: expected ')' before '}' token
main.cpp:240:3: error: expected ';' before '}' token
main.cpp:123:14: warning: unused variable 'a' [-Wunused-variable]
signed int a;
^
main.cpp: At global scope:
main.cpp:240:4: error: expected unqualified-id before 'while'
}while (play!=0)
^
main.cpp:242:5: error: expected unqualified-id before 'return'
return 0;
^
main.cpp:243:1: error: expected declaration before '}' token
}
^ |
You put one too many closing braces (
}
) at the end, so this part:
240 241 242 243
|
}while (play!=0)
system("pause");
return 0;
}
|
is actually outside of
main (that first closing brace there on line 240 ends the
main function).
Again, some indentation would make these errors much clearer.