/* ftell example : getting size of a file */ #include int main() { FILE * pFile; long size; pFile = fopen("myfile.txt","r"); if (pFile==NULL) perror ("Error opening file"); else { fseek(pFile, 0, SEEK_END); size=ftell (pFile); fclose(pFile); printf("Size of myfile.txt: %ld bytes.\n",size); } return 0; }