I need to write an array of int to an output file as binary and also read the binary data as int in the programme in C++ Linux, something like the BinaryReader and BinaryWriter in C#. How could I do that?
Thanks
Barring some outstanding reason to do otherwise, you'd typically use std::ostream::write and std::istream::read. Since you're producing a binary stream, you'll also typically want to specify std::ios::binary when you open the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With