File Handling 2

 #include<iostream>;

#include<fstream>
#include<string>
using namespace std;

int main() {
//Write
//ofstream file_obj("sabir.xyz");

/*file_obj << "#$!!%&&()_{}[]|\\n \\t ";
file_obj.close();*/


//============Read========
fstream file_read("sabir.xyz",ios::trunc|ios::out|ios::in);
string data;

while (getline(file_read,data))
{
cout << data <<endl;
}
file_read.close();



cout << "()\\n \\t couter ";
return 0;
}

Comments

Popular posts from this blog

Dynamic Memory2

Template

MultiLevel