guys i have a little problem in my file handling program that is i cant get the whole file to be saved just the end portion i want to know why this happens and how to counter it
// file handling flag testing and practise.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<cstdlib>
#include<fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
fstream infile("D:\\muqeet.txt");
char name [10000];
int experience;
char city [10000];
/*infile>>"Enter Your Name(Without Space):";
cin>>name;
cout<<"Enter Your City(Without Space):";
cin>>city;
cout<<"Enter Your Experience(Without Space):";
cin>>experience;*/
while(!infile.eof())
{infile.getline(city,10000);
;}
cout<<city;
system("pause");
return 0;
}
one more thing that is if i place the cout with in the while loop it shows every word this is curious can any one explain how this happens