I'm currently running into a few problems surrounding passing an objects return value through a function. My function is prototyped in .h and defined in .cpp. the function for example Class::function(int value);
takes in an integer of value. When I'm calling the object objectName name;
and passing it through as Class::function(name);
.
// foo.h
class foo
{
void function(int value);
}
//foo.cpp
void foo::function(int value)
{
// CODE HERE
}
//main.cpp
int main()
{
objectName name;
foo::function(name);
}
The errors that I am receiving go along the lines of:
Main.cpp:43:23: error: no matching function for call to ‘class::function(objectName&)’ name.function(name); // passes value to the function