Using string, ifstream and ofstream object. Compiling - ok, but give a run-time error after printing Name in ReadData() function.
My Person class include only one string member "name" and function "Name()" which return string object "this->name". And constructor with string parameter of course...

#include <iostream>
#include <fstream>
#include "Person.h"
using namespace std;

void ReadData(string path)
	ifstream rFile;
	Person temp;
	rFile.open(path, ios::in);
	rFile.read((char*)&temp, sizeof(temp));
	cout << temp.Name();

void WriteData(string path)
	ofstream wFile(path, ios::out);
	Person man("My Name");
	cout << man.Name();
	wFile.write((char*)&man, sizeof(man));	

can someone give a tips for this?

Just because you can cast an object to a pointer to char doesn't mean it's safe. Unless your class is POD, punning to a byte stream is begging for data corruption.