Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File handling in c++ #874

Open
Sana-Afzal123 opened this issue Sep 21, 2024 · 1 comment
Open

File handling in c++ #874

Sana-Afzal123 opened this issue Sep 21, 2024 · 1 comment

Comments

@Sana-Afzal123
Copy link

File handling in c++

@Sana-Afzal123
Copy link
Author

#include
#include
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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant