Usoing fopen etc is there a way to find file size

A

Angus Comber

Hello

I want to open the entire contents of a binary file (the files are quite
small) into memory. How can I find out the file size in bytes of the file I
am opening?

Angus Comber
(e-mail address removed)
 
R

Richard Heathfield

Angus said:
Hello

I want to open the entire contents of a binary file (the files are quite
small) into memory. How can I find out the file size in bytes of the file
I am opening?

See FAQs 12.40 and 19.12.
 
R

Richard Heathfield

Mike said:
I don't see a 12.40. Did you mean 12.38 (the highest number
I see under section 12) ?

No, I meant 12.40 but it's my fault for not checking the online version. The
book has a 12.40, but some of the book answers aren't present in the online
version.
 
M

Mike Wahler

Richard Heathfield said:
No, I meant 12.40 but it's my fault for not checking the online version. The
book has a 12.40, but some of the book answers aren't present in the online
version.

Ah, OK thanks, hadn't thought of that. I have the hardcopy of the
C++ FAQs but not the C one. I suppose I'll put that on my list for
next visit to the bookstore. :)

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top