bparsh1128
New Coder
What's going on?
So I created an object that requires an array that contains three integers.
To get those integers I have to parse the values and place them in the object using a for loop.
Originally I had three separate strings for each value and no array and it worked but I was then told to use a for loop that places all three integers in the object array.
Please let me know if I need to clarify and I appreciate any insight or the fact that you even looked at it.
//The object---------------------
// This is the function using a for loop----------------
//Parsing Method------>After parse, I place each value in the Student object using a function at the end (all others work). For this specific set of values I execute the function on the first one expecting to loop through the next two parse and place all values in the object.
Like I said I appreciate the help and if I need to further clarify let me know.

So I created an object that requires an array that contains three integers.
To get those integers I have to parse the values and place them in the object using a for loop.
Originally I had three separate strings for each value and no array and it worked but I was then told to use a for loop that places all three integers in the object array.
Please let me know if I need to clarify and I appreciate any insight or the fact that you even looked at it.
//The object---------------------
C++:
Student::Student(int days[]) {
for (int i = 0; i < daysArray; i++)
this->days = days;
}
// This is the function using a for loop----------------
C++:
void Student::setDaysInCourse(int days[]) {
for (int i = 0; i < daysArray; i++)
this->days = days;
}
//Parsing Method------>After parse, I place each value in the Student object using a function at the end (all others work). For this specific set of values I execute the function on the first one expecting to loop through the next two parse and place all values in the object.
C++:
d = i + 1;
i = studentDataTable.find(",", d);
daysInCourse1= stoi(studentDataTable.substr(d, i - d));
classRosterArray[ind]->setDaysInCourse(daysInCourse1);
d = i + 1;
i = studentDataTable.find(",", d);
daysInCourse2 = stoi(studentDataTable.substr(d, i - d));
d = i + 1;
i = studentDataTable.find(",", d);
daysInCourse3 = stoi(studentDataTable.substr(d, i - d));
Like I said I appreciate the help and if I need to further clarify let me know.

