Hi all.
I need urgent help. I have a deadline to meet and i am stuck on this stupid problem.
Basically i am implementing my own virtual file system. I need to store data on it, raw data, about files and stuff. The problem is if i have a structure of 512 bytes, i need to store it on the virtual disk with size of 512 bytes. I can read from and write to the disk character buffers. I need to store the structure on the disk. But this structure has ints and char* s.
If i convert the ints to chars i get larger overall buffer which can't fit in a 512 bytes on disk.

So is there any way i can convert the struct to a char*, keeping the ints to 4 bytes characters. Actually they are unsigned shorts (2 bytes). So it's like i need to read 1 byte from the short and convert it to char and then read the other byte. (then convert back when filling the structure).

Thanks alot, guys!