Please don't confuse with the title as it was already asked by someone but for a different context
The below code in Visual C++ Compiler (VS2008) does not get compiles, instead it throws this exception:
std::ifstream input (fileName);
while (input) {
string s;
input >> s;
cout << s << endl;
};
But this code compiles fine in cygwin g++. Any thoughts?