i am using Dev C++ on windows xp
#include
#include
#include
using namespace std;
int main ()
{
string S
If you change your loop to
while(getline(infile,STRING))
{
cout<<STRING;
}
you avoid the possibility of reading the last value twice (see this SO post).
std::ifstream::eof
is a function that returns a bool. Thsu you have to call it like
infile.eof()
You forgot the ()
after the eof
.