Dear All,
I am getting one more doubt..what exactly following peace of code will do?
Code:#if FS_AdcStatusChn0 == FS_AdcStatusChn0_ACTIVE AdcChn0 | #endif
Dear All,
I am getting one more doubt..what exactly following peace of code will do?
Code:#if FS_AdcStatusChn0 == FS_AdcStatusChn0_ACTIVE AdcChn0 | #endif
What's with all the macro hacks you're asking about?
Depends on the context, get a C book. That way you won't ask about every possible combination of pre-precessor "codez".
Btw it's not a "doubt" if it's a question, a doubt is where you think it does x but you're not sure.
It says to the compiler that it should generate the code inside the #if when the condition is true. What that achieves, as stated by zacs7, depends (a lot) on the context.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
People are interested in if you have something like
Which either means you haveCode:flags = foo | #if FS_AdcStatusChn0 == FS_AdcStatusChn0_ACTIVE AdcChn0 | //Only this part i am not able to follow:- #endif bar;
ORCode:flags = foo | AdcChn0 | //Only this part i am not able to follow:- bar;
Code:flags = foo | bar;
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.