User Profile

Collapse

Profile Sidebar

Collapse
viettrung
viettrung
Last Activity: Apr 24 '08, 10:12 AM
Joined: Apr 11 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • viettrung
    replied to Two classes share common data - How to?
    in C
    Hi RRick,

    Your explaination is very clear for me to see the advantages of the three solutions in this matter. I will consider about them. Many thanks!

    @all: Again, thank you very much for your support. I have learned many valuable experiences from you.

    Best regards,

    .viettrung.
    See more | Go to post

    Leave a comment:


  • viettrung
    replied to Two classes share common data - How to?
    in C
    Hi Ganon11,

    Thanks alot for you suggestion. That is a good idea. But in my case, the two classes have no relationship else but sharing the common data list. So logically I do not want them to share the same parent.

    Have a good day!

    .viettrung.
    See more | Go to post

    Leave a comment:


  • viettrung
    replied to Two classes share common data - How to?
    in C
    Hi uofm,

    Thanks so much for your solution.

    Actually I have thought about this solution before, but one point makes me not totally satisfied is that class A and B seem to be closely coupled to each other. Specifically class B should know about A to get the common data. Do you think so?

    By the way, I have just googled for this matter and found out something called Monostate Pattern which, I think, may...
    See more | Go to post

    Leave a comment:


  • viettrung
    started a topic Two classes share common data - How to?
    in C

    Two classes share common data - How to?

    Hi,

    I have two classes that share a common data list (specifically, a std::vector). This data list should be accessed by the two classes only, so I think using a global variable is not a good solution. Actually I am so confused to find an elegant way to store such common data for the two.

    If you have any idea about that, please let me know.

    Thanks alot!

    .viettrung.
    See more | Go to post
No activity results to display
Show More
Working...