Question: C programming. 1. Create a program that does the following - Creates three pointers, a character pointer professor, and two integer pointers student_ids, grades -Using
C programming. 1. Create a program that does the following - Creates three pointers, a character pointer professor, and two integer pointers student_ids, grades -Using dynamic memory, use calloc to allocate 256 characters for the professor pointer Prompts the professor for their name, and the number of students to mark. Stores the professor's name using the professor pointer and in an integer the number of students to mark Using dynamic memory, use malloc to allocate memory for student_ids and grades to hold the number of students the professor needs to mark. The program does not need to do anything else, ensure that you free your memory before terminating You will need to review the malloc, calloc, and sizeof documentation. 2. Building upon the previous questions you will create a marking system for professors at UOIT. Structs can be used the same as any other data type in C, instead of having two arrays for the grades and student is create a struct called grade that contains two integers: student_id and mark. Create a function grade students which takes the following arguments: a pointer to the grade struct called grades, and an integer num_students. The function returns void and does the following: Opens the file grades.txt in write mode -Using the num_students parameter iterates through all of the grade structs pointed to by the grades parameter (remember arrays are pointers, you can treat neinters like arrays)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
