Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include<fstream>
- #include<iostream>
- int main(){
- ifstream fin;
- ofstream fout;
- int a=235,b=237;
- fout.open("temp.txt");
- fout<<a<<endl;
- fout<<b<<endl;
- fout.close();
- fin.open("temp.txt");
- int temp;
- while(fin.eof()!=1){
- fin>>temp;
- cout << temp;
- }
- fin.close();
- return 0;
- output should be:235237
- but instead of this ,,it is showing :235237237
- hence,it is showing 237 2 times.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement