Can someone explain, how can read a binary file. I'm really nervous with this.
eranga262154
22
Junior Poster
Recommended Answers
Jump to PostBecause the quick and easy way is usually more costly in the long run? :D
How's that? can you show an example?
You don't have to read it one byte at a time if that's what you're worried about.
// Get the binary data char iobuf[1024]; while ( …
Jump to PostHow's that? can you show an example?
I can't, but my teachers like to say that if you don't do something right the first time, you end up doing it again and again to fix the problems. It seems to me that using an array is bad because you lock …
Jump to PostThe number of bits in the file is the number of bytes in the file multiplied by the number of bits in a byte.
Jump to PostSnippets out of context don't receive real answers.
Jump to PostI can't compile your previous code and run it. If you could actually post the current code that demonstrates the issue you are facing, it would expedite the most correct answer.
All 33 Replies
GreenDay2001
eranga262154
22
Junior Poster
GreenDay2001
eranga262154
22
Junior Poster
GreenDay2001
galin
0
Newbie Poster
eranga262154
22
Junior Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Hamrick
150
Posting Whiz
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Hamrick
150
Posting Whiz
vijayan121
1,152
Posting Virtuoso
iamthwee
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Hamrick
150
Posting Whiz
Ancient Dragon
commented:
Good example of how to make std::string work with binary files
+18
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
eranga262154
22
Junior Poster
eranga262154
22
Junior Poster
eranga262154
22
Junior Poster
eranga262154
22
Junior Poster
Dave Sinkula
2,398
long time no c
Team Colleague
eranga262154
22
Junior Poster
Dave Sinkula
2,398
long time no c
Team Colleague
eranga262154
22
Junior Poster
Hamrick
150
Posting Whiz
eranga262154
22
Junior Poster
Dave Sinkula
2,398
long time no c
Team Colleague
eranga262154
22
Junior 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.