hey..i m having trouble with fixed-length format..suppose i wanna create a struct to store my variables n later on convert it into binary file format from raw text file like below :
/* this only part of the source code. not a full program*/
Code:
struct test {
char a[10];
char b[10];
char c[5];
unsigned int d;
};
how do i made the int d occupy at most 1 byte to be stored in binary format (for eg.if int d is equal to 48 and it must stored in 48(in decimal)
but it must no be stored as the string 48, that occupying 2 bytes. Can anyone give a tips??Thanks