heylo guys! im new here, just registered today!! yay!!!
ok im trying to write a program that takes an input file, reads its character by character and writes to a output file character by character.
now the problem is for example: input = 1 2 3 4 5, output = 1 2 3 4 5 4
and i really can't figure out why except maybe i dont know how to use feof...
here is the code, please help!!
int main(int argc, char* argv)
char* infile = argv;
char* outfile = argv;
FILE* inptr = fopen(infile, "r");
FILE* outptr = fopen(outfile, "w");
fread(&data, sizeof(int), 1, inptr);
fwrite(&data, sizeof(int), 1, outptr);