How I can Use Malloc to Read file in Array, this is complex problem. Please help me!

Joined
Jan 14, 2010
Messages
2
Reaction score
0
Say my file have 4gb of size, and I want it to putted on Array of Unsigned Integer as binary.

the max size C can handle array is 99999999, aproximately 99mb. I recomended by some of friends in facebook to use malloc. I search about malloc and found that malloc is used to buffering bytes in memmory (Am I wrong?)

the question is, how I can use malloc so it can handle 4gb of files, and then write it in array? It must be on array, or something else way (if there) to evaluate its binary. How to read a file, and how to write it back to a file.

please reply asap, i need your help guys!
 
Last edited:
Joined
Jan 14, 2010
Messages
2
Reaction score
0
say the code line is like this:

int x[99999999] //it is array to handle bit to read/write file

FILE *fileopen

n as integer;
open file and handle to file
while file is open and not at End Of Line
write it to x[n];
n=n+1;
end while

but, such code can handle big file, just 99mb of file... help help, please help...
 

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,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top