A compiler may leave holes in structures by padding the first char in the structure with another byte just to ensures that the integer that follows is stored at an location. Also, there might be 2extra bytes after the integer to ensure that the long integer is stored at an address, which is multiple of 4. Such alignment is done by machines to improve the efficiency of accessing values.
4. It is not possible to create an array of pointer to structures.
Since the structure contain a
char pointer while writing the structure to the disk using
fwrite() only the value stored in pointer
n will get written. so
fread() fails to read.
7. Is there easy way to print enumeration values symbolically?