Original Post
Hi, i'm trying to read a binary file containing integers, and then write the file in ascii mode. What i do is this: #define IDRISI_MAP_X 256 #define IDRISI_MAP_Y 256 unsigned int *idrisipMap = (unsigned int *) malloc( IDRISI_MAP_X * IDRISI_MAP_Y ); FILE *idrisi ; idrisi = fopen(project_texture , "rb" ); fread( idrisipMap, 1, IDRISI_MAP_X * IDRISI_MAP_Y, idrisi ); fclose(idrisi); // Finished reading file, now we start to write FILE *idrisi_out ; idrisi_out = fopen("C:\\temp\\idrisi_out.txt" , "w" ); for (int i=0; i 16384 //fprintf(idrisi_out,","); This works filling the file with , } fclose(idrisi_out); I'm no expert, so i do not know how to use the debugger, and i dont understand what is the problem: seems to me i allocated the idrisipMap pointer correctly, but for some reasons it has an overflow. Thanks Alex