how to create and write into a file using C++
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
ofstream out;
out.open("student.txt",ios::out|ios::app);
out<<"Hello I am ujjal\n";
out<<s<<endl;
out.close();
return 0;
}
0 Comments