Hi everyone.
I have an array of a struct that I'm trying to pass to a function. When I just use the name of the array (list) in the function call, the compiler underlines the function name and says "Error: more than one instance of the overloaded function matches the argument list" and when I try it as list[], it underlines the ] and says "Error: expected an expression." Unfortunately, I'm a newbie and don't know what these mean. Please help!
This line: getItem(list[], "Please enter the course name: ", MAX_CHAR);
Should be: getItem(list, "Please enter the course name: ", MAX_CHAR);
You're passing the entire array so you just need the name. In your function prototype and definition, the compiler needs to know it's an array so you can modify it.
Also, your loop doesn't work in getItem, unless you intended it to only get one item. But everytime you call getItem how it is now, it will always ONLY set the first index of the array.
That's what I thought, but when I do it like this: getItem(list, "Please enter the course name: ", MAX_CHAR);
it underlines getItem and says "Error: more than one instance of the overloaded function matches the argument list."
I haven't written any other functions yet and only call getItem once so far. So, what's up with that?