I/O array of integer

hi,

im trying to read and write an array of integer to/from a file. i use this to
write to a file:

fwrite(texel, sizeof(int), size, fp);

and this to write it:

(*out) = new int[size];
fread((*out), sizeof(int), size, fp);

but the data read from the same file is different. im not sure what happened but
from the real data, its a bunch of integer with differnece = 2 (even numbers)
but when i read it, its a sequence of number(1, 2, 3, 4). i think its halved or
something.

any idea why?

thanks in advance
Topic archived. No new replies allowed.