サンクス 出来ました
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

main(){
string s="this a pan.", t;
fstream fp;
fp.open("stringdat", ios::out | ios::binary );
fp.write( (char*) &s, sizeof(s));
fp.close();

fp.open("stringdat", ios::in | ios::binary );
fp.read( (char*) &t, sizeof(s));;
fp.close();
cout<<t;}