1. Student ** createStudentList(char ** names, int size); - function creates an array of pointers to Student...
Question:
1. Student ** createStudentList(char ** names, int size); - function creates an array of pointers to Student objects dynamically. It allocates Student objects and set their name as the passed in “names” and gpa as 0. “size” is the number of “names” available. You can allocate 2*size as many pointers to Student objects just in case you need to add more to the list. For the extra spots in the array, set them to nullptr. The function returns the pointer to the Student pointer array.
2. bool destroyStudentList(Student ** studentList, int size); - function deletes all the Student objects in the array along with their dynamically allocated data members, such as name. It also releases the array of the pointers to the Student objects. The function returns true if the operation is successful and false if “studentList” contains nullptr.
C++. Given the following struct declaration:
struct Student
{
* name;
gpa;
};