File Handling Truc Mode

 #include<iostream>;

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

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

file_obj << "abcd ";
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();

return 0;
}

Comments

Popular posts from this blog

Dynamic Memory2

Template

MultiLevel