My professor provides the function definition in our homework so that we do the assignment the way she wants. The definition she provided looks like this;
void outputStudents(struct student [], int size)
Usually she provides the names of the variables, for grading purposes, so I wanted to be sure. Do I need to change the declaration to include a name for the student object, such as
void outputStudents(struct student classroom[], int size)
or is there a way to access it the way it's written?
Sorry if this seems like an obvious question, but structs and pointers are throwing me for a loop (no pun intended), so I want to make sure before I change anything. She does make mistakes sometimes, so its hard to tell if I'm just confused, or if there's an error in the problem.
Edit: Ok, thanks guys. I understand that variables can have any name, but like I mentioned, usually she provides us with the exact function header should say(and takes off points if we change it unnessesarily), for grading purposes since she and the other two TAs look at hundreds of these a week. So I wanted to be sure that I wasn't overlooking something.
Names of arguments can be omitted from the declaration (only the types matter). When you actually implement it, you must of course name the argument in order to use it.
Argument name will be important only when implementing. In declaration they can be ignored because there the type is most important thing. You have to assign a name to the argument to be able to use it of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With