Open Sana-Afzal123 opened 2 months ago
using namespace std; int main(){ ofstream outputFile("text.txt"); if (outputFile.is_open()){ outputFile<<"C++ is a high level language\n"; outputFile <<"first released in 1985\n"; outputFile <<"current C++ is objects oriented programming\n"; outputFile <<"it is also implement in compiled language\n"; outputFile <<"many vendor provide C++ programing\n";
outputFile .close(); cout<<"text is present in file\n";} else { cout<<"failed to create the file\n";} return 0; }
File handling in c++