how to write/read binary file

how to write/read binary file

Page 1 of 1

1 Replies - 6072 Views - Last Post: 24 September 2008 - 09:51 PM Rate Topic: -----

#1 sarma.deepak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-September 08

how to write/read binary file

Posted 24 September 2008 - 09:46 PM

how to write/read binary file with having vector .
Is This A Good Question/Topic? 0
  • +

Replies To: how to write/read binary file

#2 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1382
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: how to write/read binary file

Posted 24 September 2008 - 09:51 PM

In C or C++ ?

In C++
#include <fstream>
//...
std::ifstream file;
//...
file.open(path_of_file, std::ios::bin);

You should open it with the ios bin state (binary)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1