FILE pointer..problem with fscanf
Hello, I am new to file pointers. All I have to do is copy the values from one file (a1.txt), add 50 to each of the numbers and save it to another file (a2.txt)
a1.txt looks like:
a2.txt should look like:
The problem is fscanf is picking up only 1 instead of 11 in the first line of a1.txt and so 51 is getting printed instead of 61 in a2.txt. However, it is working fine for the subsequent lines. I am unable to figure out the problem...Kindly help...
here is the code:
ch = fgetc( fp ) ;