Classes as arguments
Posted on 2004-10-24
When passing a class as a parameter to another class' method, is there any thing I should bear in mind? Maybe some overloading of the = operator, or something else?
I am getting a "Debug Assertion Failed" when the method is called. I commented out the entire inside of the method, so the code now looks something like this:
void brokenMethod(A instanceOfA);
void B::brokenMethod(A instanceOfA)
// ALL COMMENTED OUT
cout << "Returning..." << endl;
int main(int argc, char** argv)
cout << "Calling brokenMethod." << endl;
cout << "Returned."
The output looks like this:
Everything complies fine. During runtime I get:
Debug Assertion Failed!
Program: <Path to my program>
As always, any help is super duper appreciated.