I'm working on a program to sort students by last name, first name, middle initial, gpa, etc. I've defined a data structure called "Student."
I wrote a function which will scan a line of a text file, then fill in each part of the "Student" data structure, and return a variable (type Student), called studentx.
Now, I need to declare an array of type "Student" and input "studentx" into each index, after it comes out of the function. Keep in mind every time I call the function, a different "studentx" will be returned.
My first problem is that I don't think I'm defining it right. I have this
but I get the error "studentrpt.c:32: error: array type has incomplete element type"
struct Student studentList;
to input my "student" variable into the studentList array, here's what I have. (it says "i" because it's in a loop, but i'm not worried about the loop right now, so don't worry about it either. As stated, the "getInfo" function returns type Student.
Now say I want to print a specific thing from a specific index of my studentList array, for example, I want to print the first name of the student in the 27th index of the array. How do I do that? What variable do i put in the printf statement?
studentList[i] = getInfo(input, student);
is it this?
Any help is appreciated, thanks!