I didn't like your example... It was so messy
I got this:
Code:
int file_read( void )
{
string high;
ifstream in( "highscore.txt" );
while (in >> high) {
cout << high <<;
}
in.close();
cin.get();
return 0;
}
Now everything comes this way, Fredrik,2Derik,3, etc... How can i break row after the point?
EDIT:
I now did like this and it works. But i want a better solution...
Code:
int file_read( void )
{
int dd = 1;
string high;
ifstream in( "highscore.txt" );
while (in >> high) {
cout << high;
if (dd == 2 || dd == 4 || dd == 6 || dd == 8 || dd == 10 || dd == 12) {
cout << "\n";
}
dd++;
}
in.close();
cin.get();
return 0;
}