I've created a struct with the following code:
struct d_entry{
bool _free;
char name[10];
bool _dir;
time_t _cDate;
unsigned short _cluster;
char reserved[6];
unsigned int _size;
};
I need my struct to be of a fixed-size of 32 bytes. According to my computer the following types (outside the struct) have the following sizes.
sizeof(bool) = 1 byte
sizeof(char) = 1 byte
sizeof(time_t) = 8 bytes
sizeof(short) = 2 bytes
sizeof(int) - 4 bytes
When I run the size of any d_entry, the size is 40 bytes. For some reason, the time_t and long types are being interpreted as 16 bytes. I haven't been able to get around this situation.