I want to write a program in C++ so that I can read a file with a file header that has 3 bytes. 1 byte for 1 variable.
I want to define a struct in C++ with 3 variables and all of them has 1 byte so that I can read value from file to these three variables.
My idea is this:
struct header{
datatype a;
datatype b;
datatype c;
}
Then I can:
FILE *fp=fopen(fileName,"rb");
header head;
fread(&head, sizeof(header),1,fp);
Those variables are used for calculating and their range is from 0-255. What datatype I can use in c++?