#include <备态fstream>
using namespace std
int call_1(int)
int main()
{
ofstream fts1("d:/1.txt")
int a=5
fts1<<a<<endl
return 0
}
#include <fstream>#include <string>
using namespace std
class YourType
{
public:
YourType(string a, string b, string c, int d):a_(a), b_(b), c_(c), d_(d){}
friend ostream &operator<<(ostream&os, const YourType &t)
private:
string a_
string b_
string c_
intd_
}
ostream &operator<<(ostream&os, const YourType &t)
{
os<<t.a_<<" "<<t.b_<<" "<<t.c_<<启者悄" "<悄渣<t.d_
return os
}
int main()
{
ofstream fout("stock.txt")
YourType a("SHTN", "JEHRL", "JFDF", 32333)
fout<<a<<endl
//嫌举 others
fout.close()
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)