The code works fine and writes the read in bytes to the file, however because the array list size is 100 bytes it will always output 100 bytes even if the actual file contents is 70 bytes. Is there a way i can stop these extra bytes being added (y)
Code:{ Output = fopen("2.txt","wb+"); for(offset = 0;offset < FileLength;offset+=100) { fread(input,100,sizeof(char),Input); fwrite(input,100,sizeof(char),Output); } }




Reply With Quote