Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   How I can Use Malloc to Read file in Array, this is complex problem. Please help me! (http://www.velocityreviews.com/forums/t711711-how-i-can-use-malloc-to-read-file-in-array-this-is-complex-problem-please-help-me.html)

sustle 01-14-2010 01:28 AM

How I can Use Malloc to Read file in Array, this is complex problem. Please help me!
 
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!

sustle 01-14-2010 01:41 AM

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...


All times are GMT. The time now is 12:38 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.