I am a student and I was writing a very simple console app, but I get a compile-time error for the following line:
I tried the following, but I only got more errors:
if((age!<=0) || (age!>=110)){/*Some code*/}
if(age!<=0 || age!>=110){/*Some code*/}
The build message is the following for the first code:
||=== Build: Debug in Drill (compiler: GNU GCC Compiler) ===|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp||In function 'int main()':|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp|41|error: expected ')' before '!' token|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
The build message is the following for the second code:
||=== Build: Debug in Drill (compiler: GNU GCC Compiler) ===|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp||In >function 'int main()':|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp|41|error: >expected ')' before '!' token|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp|52|error: >expected ')' at end of input|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp|52|error: >expected statement at end of input|
Principles and Practice Using C++\Code and Notes\3\Drill\main.cpp|52|error: >expected '}' at end of input|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Also, I tried putting ')' before '!', but it did not help.
Aucun commentaire:
Enregistrer un commentaire