C++,读取文件里存储的一个类对象出错了,真心!

C++,读取文件里存储的一个类对象出错了,真心求助!!!
我想在文件里存进去一个类对象,然后再把它读出来,结果存的时候弹出个对话框,内容如下(插入图片太麻烦了):
文件加载:
使用简体中文(GB2312)编码加载文件Material_list.bin时,
有些字节已用Unicode替换字符替换,保存该文件将不会保留原始文件内容。
然后再打开这个文件把类对象重新读出来的时候就会读出来一堆乱码,已经纠结一天了,实在是想不明白为什么了,求各位大神帮忙!
先上代码:
[code=C/C++][/code]
//date_material.h
#pragma once
#include<string>
#include<cstring>
#include<iostream>
#include<fstream>
#include<time.h>
#include<stdio.h>
using namespace std;
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;
struct num_material
{
int num;
};
class date_material
{
char name[80];
Single price;
float density;
float Time;
public:
date_material()
{
price=0;
density=0;
Time=0;
}
date_material(String^ newDate_name,Single newDate_price,Single newDate_density)
{
Single year,month,day;
struct tm *ptr;
time_t t;
t=time(NULL);
ptr=localtime(&t);
year=ptr->tm_year+1900;
month=ptr->tm_mon+1;
day=ptr->tm_mday;
Time=year*10000+month*100+day;

char* stringPointer = (char*) Marshal::StringToHGlobalAnsi(newDate_name).ToPointer();
for(int i=0;i<sizeof(stringPointer);++i)
name[i]=stringPointer[i];

price=newDate_price;

density=newDate_density;
}
char *Get_name()
{
return name;
}
Single Get_time()
{
return Time;
}
Single Get_price()
{
return price;
}
Single Get_density()
{
return density;
}
friend class From_selectMaterial;
}
//Form_selectMaterial.cpp
#include "date_material.h"
//输入数据
void Form_selectMaterial::add_date(date_material *date)
{
fstream outToFile;
outToFile.open("Material_list.bin",ios::binary|ios::app);
if(!outToFile)
{
MessageBox::Show("无法成功打开材料存档,请检查!","出错了",MessageBoxButtons::OK);
}
outToFile.write((char*)&date,sizeof(date_material));
outToFile.close();
}
//读取数据
void Form_selectMaterial::Get_date()
{
date_material temp;
fstream inToFile("Material_list.bin",ios::binary|ios::in);
inToFile.read((char*)&temp,sizeof(date_material));
inToFile.close(); 
}

------解决方案--------------------
你使用了中文,这种事情在C++里面就比较麻烦。你有两个选择。
1、不要往文件中写中文。
2、一定要读写中文的话,必须找一个库写Unicode或者UTF-8文件。