Improve company productivity with a Business Account.Sign Up

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

How C++ objects Communicate to each other

Hi experts!

In many of the books i have read describe that " C++ objects communicate each other",and this concept is the one which confuses me most.

Can anybody explain me How this communication between objects is done with "theoriotical" and "code example"
or else give me link which expalins me about this concept


Thanks in advance
-Shanti
 


 
0
shanti_priya
Asked:
shanti_priya
  • 5
1 Solution
 
rajeev_devinCommented:
Theoratically Objects communicate with each other by passing message.
0
 
rajeev_devinCommented:
Pratically they communicate with each other by calling member functions.
0
 
rajeev_devinCommented:
Example:

class Door
{
public:
   open(); // message to open the door.
};

class Car
{
   Door leftDoor; // door object, for left door
   Door rightDoor;, // door object, for right door
public:
   openLeftDoor() {    // message to open the left door of the car
      leftDoor.open(); // internally it is passing the message to the door object to open it.
   }
   openRightDoor() { // message to open the right door of the car
      rightDoor.open();
   }
}
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
grg99Commented:
C++ objects do NOT communicate with each other.  Let's settle that.  There is no built-in feature in C++ to do this.

0
 
rajeev_devinCommented:
>> C++ objects do NOT communicate with each other.  Let's settle that.  There is no built-in feature in C++ to do
>> this.
Is that true ?
Then how one object uses another object ?
0
 
rajeev_devinCommented:
Also I want to know in which language object communicate with each other ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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