Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

object communication


sir

 i m working on ansi c .


 here , class A
          class B

wat r the differnt communication possible bet objects of these classes

ie , A a ,B b ; how can u communicate bet  ,a & b
  ??
0
karana
Asked:
karana
  • 3
1 Solution
 
rajeev_devinCommented:
>> i m working on ansi c .
I think C++ :)
0
 
rajeev_devinCommented:
>> wat r the differnt communication possible bet objects of these classes
What exactly A and B do ?

Until you are not sure about the class of object you cannot put members in it.
0
 
rajeev_devinCommented:
0
 
bpmurrayCommented:
First, when posting a question, please write in English - NEVER use the abbreviations you might use in SMS messages. So the words are "what", "are", "you", etc.

The idea that objects communicate with one another simply refers to the way in which they refer to each other's  methods. There are very complex solutions that use message queues where an object adds a message to another object's message queue, but it's still just calling a method on the other object. Now, objects can have two different kinds of relationships - "is a" and "has a". If A "is a" B, it simply means that A is a descendant of B (inheritance), while if A "has a" B, it means that A contains an instance of B. In both of these situations, class A can execute a method on the class B, and that's how they communicate.
0
 
rstaveleyCommented:
Objects call other objects' class functions, which rajeev_devin argues in http:Q_21890796.html is the extent of inter-object communication natively supported by the C++ language. I agree with him. That's all the language provides you. You can design your own message queues or use message queues provided by your operating system or use interprocess communication in C++, but that's beyond the scope of what's provided by the C++ language.

> wat r the differnt communication possible bet objects of these classes

Name your operating system if you want to use an API or define the height of your sky if you want to design something yourself. You might have an object responsible for banging a drum, which another object listens to.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now