RamHardikar
Programmer
1) I declare 2 file pointers -
FILE *fp1, *fp2;
2) Using 'fp1' I open a file for reading in binary mode -
fp1=fopen("test","rb");
3) I use 'fp2' to point to same memory what fp1 is pointing to -
fp2=fp1;
4) Using 'fp2' I read a record from the file 'test' using a structure -
fread(&rec,sizeof(struct st),1,fp2);
Question -
What is the impact on pointer 'fp1' after step #4 is executed? Where will 'fp1' point to?
FILE *fp1, *fp2;
2) Using 'fp1' I open a file for reading in binary mode -
fp1=fopen("test","rb");
3) I use 'fp2' to point to same memory what fp1 is pointing to -
fp2=fp1;
4) Using 'fp2' I read a record from the file 'test' using a structure -
fread(&rec,sizeof(struct st),1,fp2);
Question -
What is the impact on pointer 'fp1' after step #4 is executed? Where will 'fp1' point to?