c - what is the address pointed by file pointer? -


    #include <stdio.h>     #include <stdlib.h>      int main()     {      file *file1;      char c;      file1=fopen("find1.txt","r");         if(file1==null)        {             printf("\n file doesnt exist\n");             exit(1);        }        else       {           while(1)           {                c=fgetc(file1);                if(feof(file1))               {                    break;               }                putc(c,stdout);            }       }     } 

what think how code work fgetc() take character file pointed filepointer , put character in "c".next time takes next character file , put in "c". filepointer increment , point next character?or handeled in other way ?

the file1 pointer not incremented. file object points contain (among other things) pointer current stream position, , that updated read or write file.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -