News for hackers. Stuff that matters.
Re:Sizeof(char) is 1 by psyklic on Monday September 06, 2010 @01:59AM (#1666021)
Ridiculous! This is like saying that we shouldn't use parentheses because all C++ programmers should know order of operations! Not only that, but it's probably optimized out by the compiler (and if not, it is a quite insignificant speedup). Better to be safe using sizeof(x) than sorry ...
Re:Sizeof(char) is 1 by chc on Monday September 06, 2010 @02:04AM (#1666030)
Absolutely optimized out. `sizeof()` is evaluated at compile time.
Re:Sizeof(char) is 1 by arethuza on Monday September 06, 2010 @04:52AM (#1666282)
Actually, I have someone who did think that about parentheses - we'd have arguments about which approach was clearer. We never did agree.