Jump to content
Tuts 4 You

Easy way to write chars to file?


Recommended Posts

By default ofstream treats the file as text file, so 0x0A will be transformed to 0x0d, 0x0a. You have to open you file in binary mode.

ofstream out("D:\\block1", ios::binary);
out.write((char *) &block1Conv, sizeof block1Conv);   



Edited by Ahmad_k
  • Like 1
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...