how do I pass a class as an argument?

how do I pass a class as an argument?
Last edited on
What do you mean by this? Do you mean pass a class object?

1
2
3
4
5
6
7
8
9
class MyClass
{
};

void func(MyClass c); // pass by value

void func(MyClass& cr); // pass by reference

void func(const MyClass& ccr) // pass const by reference (preferred method if the object is not to be changed 
Last edited on
Yes, I was not sure how to pass it by value. Thanks.
Topic archived. No new replies allowed.