Erasing file information

Hello, I'm not very good at coding. My assignment was to open a file and do different things to it. The file is a baseball themed filed with information about players. I have to erase players that didn't come back. My idea was to have them enter the players who don't come back. Here is my code for that section so far:

//menu option 3: delete player
else if (menuOption == 3){
string playerId = "",
lastName = "",
firstName = "",
division = "",
team = "";

//opens file
ofstream outFile;
outFile.open("Master_Data.csv", ios::app);

//determine whether file was open
if (outFile.is_open())
{
string playerId;

cout << "Who did not return? Enter Player ID. Enter Done when finished." << endl;
cin >> playerId;
getline(cin, playerId);
while (playerId != "Done")
{
string playerId;
playerId.erase()

}

Since I don't know what the subscripts would be for the players they want deleted because it would be random, that's where I got stuck. If you could help me with this code or come up with a better way, thanks!
Not sure what you mean by the subscripts. Do you mean the playerId?
for the erase function its string.erase (subscript,[count])
Are you storing your player info in an array of struct?

i.e.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct player
{
    string name;
    string team;
    int age;
    int height;
    int weight;
    
};

struct player basketballplayers[24];
basketballplayers[1].name = "Michael Jordan";
basketballplayers[1].team = "Chicago Bulls";
...
There's like 300 names so i can store each name so how would i go about doing that?
Topic archived. No new replies allowed.