vlakas1981
Programmer
hi all,
this is my really urgent question:
I have an array of 256 elements, each element being the following struct:
struct coded_letter{
int size;
int *elem;
};
elem is a variable length int array.
i populate it, write it to a (binary) file, along with other data (an integer, and afterwards a series of bytes), and then try to read it, using the command
fread(l_table,sizeof(l_table),1,fps);
(l_table is again an array of 256 elements of the same struct)
when reading the values of this array, i get correct values for the l_table.size element, but not for the .elem element.
What is the problem???
Thanks in advance
this is my really urgent question:
I have an array of 256 elements, each element being the following struct:
struct coded_letter{
int size;
int *elem;
};
elem is a variable length int array.
i populate it, write it to a (binary) file, along with other data (an integer, and afterwards a series of bytes), and then try to read it, using the command
fread(l_table,sizeof(l_table),1,fps);
(l_table is again an array of 256 elements of the same struct)
when reading the values of this array, i get correct values for the l_table.size element, but not for the .elem element.
What is the problem???
Thanks in advance