#include <iostream>
#include <fstream>
using namespace std;
void main()
{
ofstream SaveFile("cpp.txt");
SaveFile << "Hello World!";
SaveFile.close();
}
#include <iostream>
#include <fstream>
using namespace std;
void main()
{
ifstream OpenFile("cpp.txt");
char ch;
while (OpenFile.eof())
{
OpenFile.get(ch);
cout<<ch;
}
OpenFile.close();
}
#include <fstream>
using namespace std;
void main()
{
ofstream SaveFile("cpp.txt");
SaveFile << "Hello World!";
SaveFile.close();
}
#include <iostream>
#include <fstream>
using namespace std;
void main()
{
ifstream OpenFile("cpp.txt");
char ch;
while (OpenFile.eof())
{
OpenFile.get(ch);
cout<<ch;
}
OpenFile.close();
}
while (!OpenFile.eof())
{
OpenFile.get(ch);
cout<<ch;
}
out.open(....);
out.write(....);
out.close();ifstream in;
in.open(....);
in.read(....);
close();给你模型,剩下的自己写吧。