Re:Stop using strncpy already
by dibbit on Thursday April 04, 2013 @07:35AM
(#5492042)
It does matter. sizeof is computed at compile time, it is not computed at runtime. something() is a runtime invocation .. sizeof() 'looks' like that, but isn't.
[ Parent
| on HN ]
Re:Stop using strncpy already
by Dylan16807 on Thursday April 04, 2013 @01:11PM
(#5493764)
1. A lot of math gets computed at compile time.
2. sizeof is not necessarily done at compile time. C99 allows variable-sized automatic arrays, forcing it to store and later look up the value at runtime if you use sizeof.