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 Post@OP
Do you mean you want to read a file into a char array? That is what your title suggests. Is there a typo error?
while (not_end_of_file) { read character into array }
You can use fgetc() (other ways possible too) to read a character from …
Jump to PostWell, yeah, why would you want to
realloc()
one character at a time? Add 512 bytes at a time.
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.