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
The key difference is that asking for type simply to take sizeof(type) can be error prone (and the errors can be hard to debug) and is redundant when the size of the type can be determined by taking sizeof() of a variable known to be of the same type in the structure passed to us. It is also sweeter syntax, as an aside.
Also, why do we use trust malloc()/realloc() to always succeed ?
The text was updated successfully, but these errors were encountered:
For instance, the following :
can be rewritten as :
The key difference is that asking for
type
simply to takesizeof(type)
can be error prone (and the errors can be hard to debug) and is redundant when the size of the type can be determined by takingsizeof()
of a variable known to be of the same type in the structure passed to us. It is also sweeter syntax, as an aside.Also, why do we use trust
malloc()
/realloc()
to always succeed ?The text was updated successfully, but these errors were encountered: