// Ch. 11 Demo Program #4
// Mr. Minich
// Purpose - to illustrate writing to a sequential access file that's opened
// in the append mode
#include <iostream.h>
#include <fstream.h>
#include "apstring.h"
int main()
{
apstring name;
int score = 0;
ofstream hiScores("hiscores.txt", ios::app);
while (1)
{
cout << "Enter your name (type \"xxx\" to quit): ";
// backslash is the escape
// operator and used to display a quotation mark.
cin >> name;
if (name == "xxx")
{
break;
}
cout << "Enter your score: ";
cin >> score;
hiScores << name;
hiScores << endl;
hiScores << score;
hiScores << endl;
}
return 0;
}// end of main