we want to read some data from text file and we want to assignment these values to x and y values..a data is just like below in tezt file:
30,59
23,54
45,65
...
we tried the below program but it doesnt give proper result...it goes an infinite loop...please help..
using namespace std;
int main()
{
ifstream inFile("input.txt");
while (!inFile.eof())
{
int x;
inFile >> x;
if( inFile.eof() ) break;
cerr << x << endl;
cout<<"Enter the name of the file: ";
cin>>filename;
fin.open(filename, ios::in);
char str[255];
while ( !fin.eof() ){
fin.getline(str,255);
cout<<str<<"\n";
}