Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How I can Use Malloc to Read file in Array, this is complex problem. Please help me!

Reply
Thread Tools

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

 
 
sustle sustle is offline
Junior Member
Join Date: Jan 2010
Posts: 2
 
      01-14-2010
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 by sustle; 01-14-2010 at 01:30 AM..
Reply With Quote
 
 
 
 
sustle sustle is offline
Junior Member
Join Date: Jan 2010
Posts: 2
 
      01-14-2010
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...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: How to check whether malloc has allocated memory properly in caseif malloc(0) can return valid pointer Gene C Programming 0 12-20-2010 05:33 AM
Malloc/Free - freeing memory allocated by malloc Peter C Programming 34 10-22-2004 10:23 AM
free'ing malloc'd structure with malloc'd members John C Programming 13 08-02-2004 11:45 AM
Re: free'ing malloc'd structure with malloc'd members ravi C Programming 0 07-30-2004 12:42 PM



Advertisments