taking variable value to another class
-
Hello all, class A: Function x class B: Function y I have already declared object of class B in class A to access member function y of B.Now i have to access function x in class B.In fact i have to take the return value of one function of class A and give it as input to one function of class B.Then mutally creating objects is giving errors,how to overcome the above problem. Regards
-
Hello all, class A: Function x class B: Function y I have already declared object of class B in class A to access member function y of B.Now i have to access function x in class B.In fact i have to take the return value of one function of class A and give it as input to one function of class B.Then mutally creating objects is giving errors,how to overcome the above problem. Regards
Maynka wrote:
I have already declared object of class B in class A to access member function y of B.Now i have to access function x in class B.In fact i have to take the return value of one function of class A and give it as input to one function of class B.Then mutally creating objects is giving errors,how to overcome the above problem.
:confused: Why not show the actual class definitions? Your paraphrased version makes no sense.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hello all, class A: Function x class B: Function y I have already declared object of class B in class A to access member function y of B.Now i have to access function x in class B.In fact i have to take the return value of one function of class A and give it as input to one function of class B.Then mutally creating objects is giving errors,how to overcome the above problem. Regards
-
Hello all, class A: Function x class B: Function y I have already declared object of class B in class A to access member function y of B.Now i have to access function x in class B.In fact i have to take the return value of one function of class A and give it as input to one function of class B.Then mutally creating objects is giving errors,how to overcome the above problem. Regards
Hi.. are you including header files in both classes, i mean.. in A.h #include "B.h" and in B.h #include "A.h" if u give so definately u will get errors, so include only in the first written class . and in secondly written class just define the first class class A; try this hope it works..