0% found this document useful (0 votes)
15 views1 page

Include

The document is a C++ program that demonstrates file handling using fstream. It creates a file, writes to it, and manipulates the file pointer to read and modify its contents. The program outputs the position of the file pointer at various stages and reads characters from the file.

Uploaded by

Sadman Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Include

The document is a C++ program that demonstrates file handling using fstream. It creates a file, writes to it, and manipulates the file pointer to read and modify its contents. The program outputs the position of the file pointer at various stages and reads characters from the file.

Uploaded by

Sadman Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#include <iostream>

#include <fstream>
using namespace std;

int main() {
fstream file("[Link]", ios::in | ios::out | ios::trunc);
file << "Good Weather";
cout << [Link]() << endl;

[Link](2);
file << "Hi";
cout <<[Link]() << endl;
[Link](0);
cout<< [Link]() << endl;
string content;
getline(file, content);
cout<< content << endl;

[Link](4);
cout << [Link]() << endl;

char ch;
[Link](ch);
cout<< ch << endl;

[Link]();
return 0;
}

You might also like