You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So many people are super confused by sizeof, and use it where they shouldn't. for example, in place of strlen. It might help some to emphasize that sizeof is (normally 1) an operator evaluated at compile time, and becomes a constant. So it doesn't know. See K&R pgs 135, and to a lesser extent 203, for more.
Note this breaks, slightly, with C99 variable length arrays where sizeof acts like an expression, not a constant. (invalid in the C++ spec as far as I can tell)
The text was updated successfully, but these errors were encountered:
So many people are super confused by
sizeof
, and use it where they shouldn't. for example, in place of strlen. It might help some to emphasize that sizeof is (normally 1) an operator evaluated at compile time, and becomes a constant. So it doesn't know. See K&R pgs 135, and to a lesser extent 203, for more.The text was updated successfully, but these errors were encountered: