Thanks!
Is it the same with enum too?
Printable View
Thanks!
Is it the same with enum too?
A struct may or may not take up the same amount of space as an enum.
You can do sizeof(struct structname) to get the # of bytes used by a struct. The same likely works for enum (never tried).
Regardless, a well written program will not depend of the size of a struct. (The size may not be the same on every platform.)
The size of a struct object, with no members in the struct is one byte. I think an enum object is 4 bytes.
thanks for your help guys