Originally Posted by
dyn4sty22
Can anyone show me the syntax for calling a function from a class with an object
The same as any other function.
Function_name(arguments);
as its paramter and the syntax for the function name in the class?
That's a little unambiguous. Do you care to try to re-explain that?
Originally Posted by
dyn4sty22
i get this error
error C2664: 'Poly::addPoly' : cannot convert parameter 1 from 'Poly *' to 'Poly'
That means the function expects an object of type Poly to be passed by value but you are trying to pass a pointer.
If you have an object, you may be trying to pass the address:
Code:
void foo(Poly p) { }
int main()
{
Poly mypoly;
foo(&mypoly); // Wrong
foo(mypoly); // Right
// Or you may have a pointer
Poly* pMyPoly = &mypoly;
foo(pMyPoly); // Wrong
foo(*pMyPoly); // Right. Dereference first.
}
Hope that helps.