Solved

How C++ objects Communicate to each other

Posted on 2006-06-18
6
519 Views
Last Modified: 2012-06-27
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
Comment
Question by:shanti_priya
  • 5
6 Comments
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16932070
Theoratically Objects communicate with each other by passing message.
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16932071
Pratically they communicate with each other by calling member functions.
0
 
LVL 12

Accepted Solution

by:
rajeev_devin earned 125 total points
ID: 16932085
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

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

0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16934496
>> 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
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16934504
Also I want to know in which language object communicate with each other ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now