I got an assignment where i have to read in unsigned short values from a .raw file. Im abit unsure on how i do this in C and what i get when i do it like i have tried to do
First of all, does this work?
//data is also an usnigned *short declared somewhere else in the program
data = ReadFile();
unsigned short* ReadFile()
FILE *file = fopen("Kaisa.raw", "r");
unsigned short* value = (unsigned short*)malloc(512*512*210*sizeof(unsigned short*));
fread(value, 512*512*210, 1, file);
If so what and how is the values stored in data. Is the numbers all in one line(that is 512*512*210 elements long)?