C++ extern function error: too many arguments to function
I have a cw.h file with a bunch of extern functions in it that I want to call from my cw.cpp file.
They are expressed like this in the .h. file along with the declarations of the Type struct (just example functions, not the actual names of the functions):
extern Type* new_type(), match(), sharetype();
But their definitions and implementations are in the cw.cpp file. Each of the functions has 1 or more parameters passed into it.
When I try compiling, I keep getting this error message for each of the functions:
cw.h:11: error: too many arguments to function Type new_type() cw.cpp:575: error: at this point in file
I have no idea how to fix it. And I've been searching for the past hour (-_-)
I changed my code in the .h file to match the types of the parameters being passed into the functions when they're being called. No more errors.
In C++, a function declared with () is a prototype and means that the function takes no arguments. In C++ it is equivalent to using (void). It doesn't have the same meaning as in C (i.e. that the function takes an unspecified number of arguments).