#include using namespace std; struct Student{ int age; int weight; }; void printPtr(int *newPtr) { cout << "newPtr = " << *newPtr << endl; } void setStudentData(Student *StudentPtr) { StudentPtr->age = 50; cout << "Function age is " << StudentPtr->age << endl; } int main() { int i; int *ptr; ptr = &i; i = 200; printPtr(ptr); int *ptr1 = new int; *ptr1 = 100; printPtr(ptr1); Student myStudent; myStudent.age = 21; myStudent.weight = 100; Student *myStudentPtr; myStudentPtr = &myStudent; Student *anotherStudent = new Student; setStudentData(myStudentPtr); setStudentData(anotherStudent); cout <<"after func call " << myStudent.age << endl; Student *Bob = new Student; setStudentData(Bob); cout << "Main Bob's age is " << Bob->age << endl; return 0; }