Hi everyone,
How this syntax is interpreted? This is like an if statement? If startup_event == BSP_EVENT_CLEAR_BONDING_DATA is true then p_erase_bonds will be true?
NickCode:p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);
Hi everyone,
How this syntax is interpreted? This is like an if statement? If startup_event == BSP_EVENT_CLEAR_BONDING_DATA is true then p_erase_bonds will be true?
NickCode:p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);
The expression startup_event == BSP_EVENT_CLEAR_BONDING_DATA evaluates to 1 if the two values are equal, 0 if they differ.
So parse-_bonds ends up with the value of either 1 or 0.
It would be more normal to use an if or the "? :" syntax here, but it is valid C and you see assignmaents of relative operator conditions quite a bit in real code.
I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
Visit my website for lots of associated C programming resources.
https://github.com/MalcolmMcLean
Thanks!! This is what I was expecting!!