Last week I took new things about pointers, but to be honest it always makes me confused and I face difficulties with it!
Here is a question about structures and pointers which I solved, but my instructor told me that I used the normal way not pointers, hope you guys have a time to check my answer and tell me how can I use pointers with it.
Part (A)
Consider the following struct declaration:
struct student
{
long ID;
string name;
float GPA;
};
Write a function named displayTopStudents that takes as parameters: a pointer to an array of type student and the array size. The function should display the ID and name of all students with GPA 3.5 and above.
Part (B)
Write a main function to create a dynamic array of type student and ask the user to input the students’ information. The number of students should be determined by the user. Then use the above function to display the top students’ names and IDs.