Read and Write Binary Data in C++ - Stream-Based I/O part 7 of n - Modern Cpp Series Ep. 197
Вставка
- Опубліковано 20 вер 2024
- ►Full C++ Series Playlist: • The C++ Programming La...
►Find full courses on: courses.mshah.io/
►Join as Member to Support the channel: / @mikeshah
►Lesson Description: In this lesson we take a look at setting up a file for reading and writing to binary using the 'binary' file mode. We'll uncover a few gotchas like how to cast data to a 'char' (single-byte) type, make sure our files are closed, and why we might want to use fixed-width types. In this lesson we'll use the member functions 'read' and 'write' to help us with binary files. Binary files in many cases are often more compressed (and less easy for our users to 'parse or guess the contents' which is one reason to use them). Of course, you will also have to consider 'endianness' of your data when opening across a different platform. As always, feel free to bring up any questions and discuss what you've learned!
►UA-cam Channel: / mikeshah
►Please like and subscribe to help the channel!
►Join our free community: courses.mshah....
Your C++ sessions are one of the best in UA-cam.
If possible, can you please make videos on Socket Programming in C/C++?
@@sudarshan_adiga_k cheers! I'll consider it!
What an amazing lesson! Thank you so very much yet again!
You are most welcome!
For episode 200, you should do something special.
Have you considered speedrunning to the part of C++/D interop? I know most people might associate it with C/Objective C, but it is fascinating when a language promotes that.
C interop? Sure yeah, the C ABI across the major 3/4 compilers is fairly os-specific, but mostly stable and easy to target/link.
Objective C interop? I used to to think that was a Swift thing, but both Odin and D (bless them) have documented it and used it and practically, it is just C with small talk, so fine there too.
C++? Well, that is much rarer. Even strongly typed languages like Rust can get hiccups because of some unseen UB.
Just a suggestion. I think it is fitting.
That's a good idea! Hmm, I definitely want to do something special for 200 (100 I did not) -- D and C++ interop should come at some 🙂