jeudi 27 février 2020

Parsing comma delimited text in C++

I am working on a project where I am given a comma delimited string of text in an array, and need to parse each array index into its own object.

For example: string studentData[] = { "Student1,Adam,Smith,ASmith@gmail.com,20", "Student2,Erick,Smith,ESmith@gmailcom,19"}

I have objects created to hold StudentName, EmailAddress, and Age, but cannot find a way to get the values from the array into the objects.

Aucun commentaire:

Enregistrer un commentaire