+ 1

Unqualified-ID... what does that mean?

Whenever I input a code like... #include <iostream> Using namespace std; Int main() { Return 0; } If (7 == 7) { Cout << “Yes”; } ...It gives me this error message... ./Playground/file0.cpp:8:1: error: expected unqualified-id before ‘if’ 8 | if (7 == 7) { | ^~ ...What does this mean and how can I fix it?

16th Nov 2020, 8:43 PM
Ying05123
Ying05123 - avatar
1 Answer
+ 5
You are putting the if statement outside in a function, see the correct way https://code.sololearn.com/cYRTHAphv3zY/?ref=app
16th Nov 2020, 8:52 PM
CoffeeByte
CoffeeByte - avatar