|
|
|
|
|
by georgeorwell
4898 days ago
|
|
Assuming a has type int: int a_val = a;
if (a_val)
printf ("returning b");
return a_val ? b : c;
Anyway, it's not useful for complicated code that needs to do lots of stuff. It's useful for simple code that ends up being more verbose with if-else. It's also useful for enforcing behaviour. |
|