Is it possible to convert this if statement into a conditional expression? is it worth it?
thx.Code:if(newIndex) s[newIndex-1] = '\0'; else s[newIndex] = '\0';
Is it possible to convert this if statement into a conditional expression? is it worth it?
thx.Code:if(newIndex) s[newIndex-1] = '\0'; else s[newIndex] = '\0';
It's up to you to determine if that's readable enough to be worth the savings.Code:s[newIndex ? newIndex-1 : newIndex] = '\0';
The information given in this message is known to work on FreeBSD 4.8 STABLE.
*The above statement is false if I was too lazy to test it.*
Please take note that I am not a technical writer, nor do I care to become one.
If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
Don't assume that I'm ever entirely serious or entirely joking.