Solved

How C++ objects Communicate to each other

Posted on 2006-06-18
6
516 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

708 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

12 Experts available now in Live!

Get 1:1 Help Now