Reputation: 11
I can't figure out why this isn't allowing me to save properly in NetBeans. It works perfectly fine in visual studios.
void scores(int x, Player users[])
{
// Declarations
fstream inScores;
string line;
string userName;
int score;
bool found = false;
userName = users[x].userName;
score = users[x].score;
```
inScores.open("Scores.dat", ios::in | ios::out | ios::beg);
```
while (getline(inScores, line) && !found) {
if (line.compare(userName) == 0) { //match strings exactly!
found = true; // found is true => break loop
inScores << score;
}
}
inScores.close();
}
I expect the program to compile like it does in visual studios, however I have no idea why the same exact code doesn't compile in netbeans.
Upvotes: 0
Views: 1023