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
Hello, I'm still a learner of the c programming language and database. The below line has uint8_t but the definitions above it are all uint32_t, I think they should use the same def, all uint8_t or all uint32_t, is there any detail here I didn't notice?
It's a matter of opinion in code and some people want to use the smallest datatype necessary. Possibly because it conveys some information to the reader that a header size won't be more than 255, whatever the number is.
This is more common in larger data structures. Say you have an absolute binary offset: you'll probably store it as a uint_64 to be safe (able to store offsets into several GBs) - meanwhile a magic header (like PNG) will be uint_8 since it's only a few bytes.
Hello, I'm still a learner of the c programming language and database. The below line has
uint8_t
but the definitions above it are alluint32_t
, I think they should use the same def, alluint8_t
or alluint32_t
, is there any detail here I didn't notice?db_tutorial/db.c
Line 96 in 051b5c0
The text was updated successfully, but these errors were encountered: