for (int k = 0; j < students.size() ; j++)
{
studentdetails student = students[j];
student.print();
}
Printable View
for (int k = 0; j < students.size() ; j++)
{
studentdetails student = students[j];
student.print();
}
creates a brand new student. Thus the student in your vector is ignored.Code:studentdetails student = students[j];