0

Hi,
I have a complex C++ code with gui. Each major gui division is independent class. Now these classes must 'talk' sometimes in operations like copy from division A and paste in division B. So I need to pass some pointers from one class to another.
I was thinking of using friend methods but I see that I have to pass object each time I call the function which complicates stuffs.
I thought then of static function but then, my pointers will have to be static and I see it will complicate stuffs. I decided to ask if anyone have met this challenge of inter class communication and how to resolve it!
Thanks a lot

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Stefano Mtangoo
0

Why not public (or protected, if the classes are related) getter/setter functions? If that doesn't make sense then I'm not entirely sure what your problem is, in that case... could you elaborate with an example?

0

Is that worse than friend or static functions in each class? I guess I'm missing something about your problem

0

Is that worse than friend or static functions in each class? I guess I'm missing something about your problem

Ok let me weigh the consequence of both approach again and I will go to simplest!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.