Expected unqualified-id before 'if' Code Answer's

Параметры сервера и не только
Ответить
ABakhsh45647
Сообщения: 3
Зарегистрирован: 22 июл 2022, 14:29

Expected unqualified-id before 'if' Code Answer's

Сообщение ABakhsh45647 »

[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);
}
}
Ответить