Passing an object into another class

Hi,

If I have a class called Class1:

With an object say

Class1 _object;

And that object has data in it that I need in Class2

How do I go about passing an object (I think I need it by reference) into another class?

I know this is probably really obvious but I am really unsure how to do it.

Regards
1
2
3
4
5
6
7
class Class1;

class Class2 {
    Class2(Class1& c1) { .. }
};

class Class1 {};
Topic archived. No new replies allowed.