How can I get a file's size in C?
Posted
by Nino
on Stack Overflow
See other posts from Stack Overflow
or by Nino
Published on 2008-10-26T20:54:57Z
Indexed on
2010/05/13
23:14 UTC
Read the original article
Hit count: 282
How can I find out the size of a file? I opened with an application written in C.
I would like to know the size, because I want to put the content of the loaded file into a string, which I alloc using malloc()
. Just writing malloc(10000*sizeof(char));
is IMHO a bad idea.
© Stack Overflow or respective owner