Talking about scopes you might have also told about problems like this: (Or as a task for the user) int a=5; { int a=6; Serial.println(a); } Serial.println(a); Brings me to the question if there is a linter or code analyses tool for Arduino like cppcheck, clang-tidy, ... in c++.
Oh, yes - I should talk about variable shadowing to another video, because this can be quite confusing. I'm afraid inside of the Arduino IDE, there is no static code check.
if (true) is always to, so whatever is written inside the {} is always executed. You will not find this in a normal program because it makes no sense, I just used it to create a different scope :)
Also a good intro to scopes in general :)
Thank you! This is a good intro series.
Talking about scopes you might have also told about problems like this: (Or as a task for the user)
int a=5;
{
int a=6;
Serial.println(a);
}
Serial.println(a);
Brings me to the question if there is a linter or code analyses tool for Arduino like cppcheck, clang-tidy, ... in c++.
Oh, yes - I should talk about variable shadowing to another video, because this can be quite confusing. I'm afraid inside of the Arduino IDE, there is no static code check.
Hi Playduino ‘If (true)’ if ‘what’ is true? Thanks 😊
if (true) is always to, so whatever is written inside the {} is always executed. You will not find this in a normal program because it makes no sense, I just used it to create a different scope :)