Hi...
i have A File And I Want to read the file and store all of its data in a single file what should i do...
Please help....
A C Code Snippet would be very helpful
rohan_k 0 Newbie Poster
Recommended Answers
Jump to PostYes a code snippet would be helpful, lets start by seeing yours.
Jump to PostWell, yeah, why would you want to
realloc()
one character at a time? Add 512 bytes at a time.
Jump to PostThen find out how big the files is first. Read through the file once so you know how big it is. Then
malloc()
the buffer and read the file in one read.Use the
read()
function to make it faster.
All 9 Replies
gerard4143 371 Nearly a Posting Maven
myk45 48 Posting Whiz
rohan_k 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
rohan_k 0 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
rohan_k 0 Newbie Poster
shibblez 2 Junior Poster in Training
abhimanipal 91 Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.