Well isn't std::string going to dynamically allocate a string according to the size of the line read in? Whereas using a char array is fixed and should be fine as long as it's big enough, right?
It seems to complete just fine with the following:
Still, why the heck doesn't the first code work?
while (std::getline(file, line))
std::cout << line << std::endl;