+ 2
How do you use the same object in different classes in C++
How do you use the same object in different classes in C++
2 Answers
+ 2
I'm sorry, I don't understand what you're trying to say here. Can you maybe give an example of what you want to do?
0
titan
Make a method and call that method in different classes. That is why we have method in classes. You can call that method by creating object of the class.
Suppose you have two class A and B and class A has a method method1()
So now create an instance of class A in class B and call class A method in Class B using the instance of class A.