CODE 1 may end in problems, too, because of the missing terminating 0 in read_array
CODE 2 is missing a rewind to begin of file before File.read(memblock,size); and has the same problem with the terminating 0. Replace memblock = new char[size]; by memblock = new char[size + 1]; memblock[size] = 0;
Last edited by jencas; Aug 22nd, 2008 at 11:27 am.
If you are forced to reinvent the wheel at least try to invent a better one!
Please use code tags - Please mark solved threads as solved