Tags: #bool #ternary #stackoverflow
https://stackoverflow.com/questions/43139144/why-is-the-ternary-operator-used-to-define-1-and-0-in-a-macro
https://stackoverflow.com/questions/43139144/why-is-the-ternary-operator-used-to-define-1-and-0-in-a-macro
Stackoverflow
Why is the ternary operator used to define 1 and 0 in a macro?
I'm using an SDK for an embedded project. In this source code I found some code which at least I found peculiar. In many places in the SDK there is source code in this format:
#define ATCI_IS_LOWER(
#define ATCI_IS_LOWER(
Tags: #stackoverflow #if vs #ifelse
https://stackoverflow.com/questions/43202012/if-statement-vs-if-else-statement-which-is-faster
https://stackoverflow.com/questions/43202012/if-statement-vs-if-else-statement-which-is-faster
Stack Overflow
If statement vs if-else statement, which is faster?
I argued with a friend the other day about those two snippets. Which is faster and why ?
value = 5;
if (condition) {
value = 6;
}
and:
if (condition) {
value = 6;
} else {
value = 5;...
value = 5;
if (condition) {
value = 6;
}
and:
if (condition) {
value = 6;
} else {
value = 5;...