Content deleted Content added
Fresheneesz (talk | contribs) adding file stdio.h and link |
Corrected the code snippet. |
||
Line 36:
A convenient, but non-standard, way to find the length of a file in C is:
<pre>
#include <stdio.h>
int main(void)
{
int length;
FILE *f = fopen("filename", "r");
fseek(f, 0L, SEEK_END);
length = ftell(f);
fclose(f);
printf("%d\n", length);
return 0;
}
</pre>
==See also==
|