[center]Expected unqualified-id before 'if' Code Answer's[/center]
Expected an ID to be given for the if condition before the statement that follows. If a block is not provided (with { ... }), an ID must be provided even if there is only one statement in the block.
Error: expected unqualified-id before return in c++
Just for the sake of people who landed here for the same reason I did
[center]
[/center]
Don’t use reserved keywords
I named a function in my class definition delete(), which is a reserved keyword and should not be used as a function name. Renaming it to deletion() (which also made sense semantically in my case) resolved the issue.
expected unqualified-id before 'if'
- void loop(){if(distanceCm < 21){
- digitalWrite(13, HIGH);
- }
- else{
- digitalWrite(13, LOW);
- }
- }
复制代码
|