| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
for some reason I cant assign information in my object into an array could someone please help me out.
part of my function to read info into my array: Student temp; temp.readOne(in); while(!in.eof() && numStudents < 20) { studentArr[numStudents] = temp; numStudents++; temp.readOne(in); } in.close(); my function to read the information in: void Student::readOne(istream& in) { getline(in, firstName); getline(in, lastName); getline(in, address); getline(in, SSN); in >> numCourses; in.ignore(200, '\n'); if (numCourses > 0) { for (int i = 0; i <= numCourses; i++) { courseArry[i].readOne(in); } } } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Assigning object information to an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|