Does fgets () move the file pointer?
Does the fgets () function automatically move the file pointer to the position before the parameter value I specified?
eg:
the content of the p.txt file is "I'm a good boy". After using fgets (a, 5, fp1) does the file pointer move forward 5 positions?
Couldn't find this in any book. Hence the request.
source to share
after using fgets (a, 5, fp1) the file pointer moves forward 5 positions?
The pointer fp1
does not affect the call fgets
(or any other I / O procedure stdio
); The object FILE
that is pointing fp1
will be updated to reflect the new file position, but the pointer itself does not change.
source to share