More of a general programming question, but:
whats the difference between if/else and #if/#else ?
whats the difference between if/else and #if/#else
Re: whats the difference between if/else and #if/#else
Its really #ifdef and #endif
These are pre-processing declarations that are used by the compiler vs actual c/c++ code that gets compiled.
So. #define x y
Replaces all occurance of x with y
Whereas
int x=y; is in code and uses a variable which takes up memory, the #define gets replaced before the compiler and so isnt a variable.
Essentially a lot of the #ifdef you see is aimed at making the ino smaller by only including code that is used.
Not sure how much that helps but maybe gets you started
These are pre-processing declarations that are used by the compiler vs actual c/c++ code that gets compiled.
So. #define x y
Replaces all occurance of x with y
Whereas
int x=y; is in code and uses a variable which takes up memory, the #define gets replaced before the compiler and so isnt a variable.
Essentially a lot of the #ifdef you see is aimed at making the ino smaller by only including code that is used.
Not sure how much that helps but maybe gets you started
Re: whats the difference between if/else and #if/#else
lol, thx. I was curious.