// Pantea Aria // Returning a pointer to a struct // Dynamic memory allocation using malloc // dereferencing using -> // Freeing memory using free #include #include #include #define MAX_LEN 100 struct student { char name[MAX_LEN]; int id; }; // Function prototypes struct student *create_student(char *name, int id); void print_student(struct student s); int main(void) { // 1. Create a student id =12345 name = "Pantea Aria" // 2. Print student details // 3. Free allocated memory return 0; } // Function to create a student and return pointer - ToDo struct student *create_student(char *name, int id) { // allocate memory for the student // check if malloc worked correctly // assign name and id to the new struct // return the new student } // Function to print student details - ToDo void print_student(struct student s) { printf("Name: %s\n", s.name); printf("ID: %d\n", s.id); }