65,210
社区成员
发帖
与我相关
我的任务
分享
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
fstream fs("t.txt",ios::app);
fs<<"123"<<endl;
fs.close();
return 0;
}
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream outfile("abc.txt", ios::app);//以追加方式打开
outfile<<"abcdef";
outfile.close();
return 0;
}
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace std;
void outPut(ofstream & os)
{
os<<"abc" <<endl;
}
void main()
{
ofstream outFile("1.txt",ios::app);
outPut(outFile);//此函数写入abc;
outFile.close();
}