Hi everyone
Hopefully u can help me with this problem. pleaseee help
How do you make my code read one line after another. Right now my code is only reading the first line, I want it to read the first and any other lines that may exist in the file.
----------FILE THAT CODE IS READING FROM-------
Name 3857
Name2 454959268
Name 3 32895 342
----------------------------------------------------------
#include <fstream.h>
#include <iostream.h>
int main()
{
char name[10];
fstream a_file("Names.dat", ios::in);
a_file>>name;
cout<<name;
a_file.close();
}
Many thanks in advance