#include "iostream"
// 文件流头文件
#include"fstream"
#include "string"
using namespace std ;
void writeToFile()
{
// 定义一个输出流类
ofstream *ofs = new ofstream;
ofs->open("test.txt",ios::out);
// 写入一些内容
*ofs<<"This is file operating"<close();
// 释放文件操作流类
delete ofs;
// return 0;
}
void readFromFile(){
// 定义输入流类
ifstream *ifs = new ifstream;
// 打开文件
ifs->open("test.txt",ios::in);
if(ifs->is_open()==false)
{
cout<<"can't open the file"<get())!=EOF)
// {
// cout<>c)
// {
// cout<getline(c,64))
// {
// cout<close();
// 释放输入流类
delete ifs;
}
int main(int argc,char *argv[])
{
readFromFile();
return 0;
}