SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
2011


 Saket Kr. Pathak
 Software Developer
 3D Graphics




[C++ Friendship - Indeed what's it ...?]
 A quick review of fundamentals of C with an prospective view of implementation in daily day
to day life.
C++ Friendship - Indeed what's it...?

A few days back I was thinking, what is Friendship and who is the Friend
Indeed. I was really a bit puzzled about the real definition and the practical
implementation of Friendship in our Daily life.

Trust me :) this is quite dangerous word for me and if I will be bit specific then, I never-
ever understand the meaning and sense, when a prefix added with this dangerous word
and it becomes "Healthy Friendship" haa haa haa :). Most of the time I had seen gals
using it ... :)

I thought to look for the antonyms of "Healthy Friendship", because sometimes
antonyms give a hazy sense to understand the actual word. So, i surfed hard around all
big search engine as Google, Bing and Alta-Vista for "Unhealthy Friendship" but as the
result, completely failed ... :( . Then after all when every door i knocked didn't open ... :),
then I came to my dearest C++ and felt the actual implementation of word "Friend" with
complete sense.

What we call friend in our life is not the actual sense of Friend, because Friend has
access to all the Private things/matters or hasn't any restriction and I am dead sure
there is no-one who share their all private stuff/matters with any single one throughout
life. ohhhooo hooo hooo :) Here I am talking about singles as i don't have any experience
of doubles or about further steps of life.

Before commenting here or blaming me wrong, think a minute and then decide. What ...
Parents ...(***knows everything just till your school days), then What ... College
time fiends ...(***common it's teen age yaar haaa :) haa :), and every one
among us knows each other well ... ;) ), then comes ... Office Colleges ... (***ask
them, if they have free time after being jealous ... ?).

But after everything there is a relationship which can be said as Friendship, if and only if
they are ideal. That's we are going to consider as my example. Let's See .... (of-course
copy-past of snippet will work this time) ...

Friend Functions (syntax C++)

//____Class as a Lady
class Gal
{
    private:
        std::string str_Nam_mood;
    public:
        Gal();
        virtual ~Gal();
        void disp();

     //Friend - Function to access Private Members

Saket Kr. Pathak                                                                         Page 2
C++ Friendship - Indeed what's it...?

    friend void my_Guy(Gal &my_friend, std::string
str_what_happn);
};

Here in our class "Gal" has a friend as function, :) named as my_Guy(,). Whenever he
meets the gal and when she became sad, he changes her mood ... ;) (***execute this if
you want to see how ?)

Gal::Gal():            //Constructor
str_Nam_mood("I not feeling good :("){}

Gal::~Gal(){}                     //Destructor

void Gal::disp()         //Member Function definition
{
    printf("n%sn", str_Nam_mood.c_str());
}

Here our dear friend my_Guy(,) function changing the mood of his Gal ... ;). As
conceptual point of view function has the access to private members of class and It can't
be said as the member function, because friend function can't be accessed by scope-
resolution, dot or arrow operators with class.

void my_Guy(Gal &my_friend, std::string str_what_happn)
//Friend Function Definition
{
    my_friend.str_Nam_mood = str_what_happn;
}

Let's have main function regarding this Gal class.

int main()
{
    Gal aGal;

    aGal.disp();
    my_Guy(aGal, "Have some Ferrero Rocher and Let's go Agra to
see Taj!");
    aGal.disp();
}
//****




Saket Kr. Pathak                                                                   Page 3
C++ Friendship - Indeed what's it...?

Friend Class (syntax C++)

Here for explaining friend-class, Yes I am going to take help from previous example with
some addition. So, there will be a forward declaration of a class who is the friend of our
previous class as;

class Guy;

Then a bit change in Gal class as;

//____Class as a Lady
class Gal
{
    friend class Guy;             //friend class as a Soulmate
    private:
        std::string str_Nam_mood;
    public:
        Gal();
        virtual ~Gal();
        void disp();
};
Gal::Gal():             //Constructor
str_Nam_mood("I not feeling good :(")
{}

Gal::~Gal()                     //Destructor
{}

void Gal::disp()
{
    printf("n%sn", str_Nam_mood.c_str());
}

Let's see how this class takes care of his friend who has given him complete access. He
feels all the happiness that the Gal - class can imagine ... :)

//___Class as a Man
class Guy
{
    public:
        Guy();
        virtual ~Guy();
        void please_change_ur_mood(Gal &dear_friend, std::string
outing);
};

Guy::Guy()                    //Constructor

Saket Kr. Pathak                                                                    Page 4
C++ Friendship - Indeed what's it...?

{}

Guy::~Guy()                     //Destructor
{}

void Guy::please_change_ur_mood(Gal &dear_friend, std::string
str_what_happn)
{
    dear_friend.str_Nam_mood = str_what_happn;
}

Now main() playing as the role of life and have a definition as,

int main()
{
    Gal aGal;
    aGal.disp();

    Guy aGuy;
    aGuy.please_change_ur_mood(aGal, "Let's marry again and We
will visit to Rome, this time!");
    aGal.disp();

     return 0;
}

Now that's a friend having complete trust and in-dependency with all the prospective
views of respect and so, ... :) ... I LOVE IT ... :) haaa haa haaa :). Hmmm :) as per
principle's of the concept, we need to notice a few points as;

Friendship is not mutual unless explicitly specified. (i.e. If you don’t introduce her/him
to your friends, then she/he is just stranger for them and I remember a song "Don't talk
to the Strangers ... Don't talk the Strangers ... Strangers Strangers" ... :) )

Friendship is not inherited. So, Inheritance stands outside here ... :)

Friendship is not transitive. (It's not mandatory that, your friend will has to be a friend
of your mate.)

That's why I like C++. :)

Ok so I don't think, It's needed to say It's completely my Prospective view to the concept
which may vary from you. So don't be personal, enjoy it ... at least try ... :)

Same as always take care in someone's style not mine, i used say catch you again :)



Saket Kr. Pathak                                                                      Page 5

Contenu connexe

En vedette

Inheritance chapter-6-computer-science-with-c++ opt
Inheritance chapter-6-computer-science-with-c++ optInheritance chapter-6-computer-science-with-c++ opt
Inheritance chapter-6-computer-science-with-c++ optdeepakskb2013
 
A Guy and gal in STL
A Guy and gal in STLA Guy and gal in STL
A Guy and gal in STLSaket Pathak
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignmentAhmad Kamal
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template LibraryNilesh Dalvi
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in CSaket Pathak
 
1. Overview of Java
1. Overview of Java1. Overview of Java
1. Overview of JavaNilesh Dalvi
 
C++ diamond problem
C++ diamond problemC++ diamond problem
C++ diamond problemSaket Pathak
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 
GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?Saket Pathak
 
Wan Important Questions
Wan Important QuestionsWan Important Questions
Wan Important QuestionsSaket Pathak
 
Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)Adair Dingle
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++Saket Pathak
 
#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop InheritanceHadziq Fabroyir
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructorsNilesh Dalvi
 

En vedette (20)

Inheritance chapter-6-computer-science-with-c++ opt
Inheritance chapter-6-computer-science-with-c++ optInheritance chapter-6-computer-science-with-c++ opt
Inheritance chapter-6-computer-science-with-c++ opt
 
A Guy and gal in STL
A Guy and gal in STLA Guy and gal in STL
A Guy and gal in STL
 
14. Linked List
14. Linked List14. Linked List
14. Linked List
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
Copy constructor
Copy constructorCopy constructor
Copy constructor
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
1. Overview of Java
1. Overview of Java1. Overview of Java
1. Overview of Java
 
C++ diamond problem
C++ diamond problemC++ diamond problem
C++ diamond problem
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?GNU GCC - what just a compiler...?
GNU GCC - what just a compiler...?
 
Wan Important Questions
Wan Important QuestionsWan Important Questions
Wan Important Questions
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)Object-Oriented Design: Multiple inheritance (C++ and C#)
Object-Oriented Design: Multiple inheritance (C++ and C#)
 
C++ Template
C++ TemplateC++ Template
C++ Template
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Strings
StringsStrings
Strings
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++
 
#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 

Dernier

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Dernier (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

C++ friendship

  • 1. 2011 Saket Kr. Pathak Software Developer 3D Graphics [C++ Friendship - Indeed what's it ...?] A quick review of fundamentals of C with an prospective view of implementation in daily day to day life.
  • 2. C++ Friendship - Indeed what's it...? A few days back I was thinking, what is Friendship and who is the Friend Indeed. I was really a bit puzzled about the real definition and the practical implementation of Friendship in our Daily life. Trust me :) this is quite dangerous word for me and if I will be bit specific then, I never- ever understand the meaning and sense, when a prefix added with this dangerous word and it becomes "Healthy Friendship" haa haa haa :). Most of the time I had seen gals using it ... :) I thought to look for the antonyms of "Healthy Friendship", because sometimes antonyms give a hazy sense to understand the actual word. So, i surfed hard around all big search engine as Google, Bing and Alta-Vista for "Unhealthy Friendship" but as the result, completely failed ... :( . Then after all when every door i knocked didn't open ... :), then I came to my dearest C++ and felt the actual implementation of word "Friend" with complete sense. What we call friend in our life is not the actual sense of Friend, because Friend has access to all the Private things/matters or hasn't any restriction and I am dead sure there is no-one who share their all private stuff/matters with any single one throughout life. ohhhooo hooo hooo :) Here I am talking about singles as i don't have any experience of doubles or about further steps of life. Before commenting here or blaming me wrong, think a minute and then decide. What ... Parents ...(***knows everything just till your school days), then What ... College time fiends ...(***common it's teen age yaar haaa :) haa :), and every one among us knows each other well ... ;) ), then comes ... Office Colleges ... (***ask them, if they have free time after being jealous ... ?). But after everything there is a relationship which can be said as Friendship, if and only if they are ideal. That's we are going to consider as my example. Let's See .... (of-course copy-past of snippet will work this time) ... Friend Functions (syntax C++) //____Class as a Lady class Gal { private: std::string str_Nam_mood; public: Gal(); virtual ~Gal(); void disp(); //Friend - Function to access Private Members Saket Kr. Pathak Page 2
  • 3. C++ Friendship - Indeed what's it...? friend void my_Guy(Gal &my_friend, std::string str_what_happn); }; Here in our class "Gal" has a friend as function, :) named as my_Guy(,). Whenever he meets the gal and when she became sad, he changes her mood ... ;) (***execute this if you want to see how ?) Gal::Gal(): //Constructor str_Nam_mood("I not feeling good :("){} Gal::~Gal(){} //Destructor void Gal::disp() //Member Function definition { printf("n%sn", str_Nam_mood.c_str()); } Here our dear friend my_Guy(,) function changing the mood of his Gal ... ;). As conceptual point of view function has the access to private members of class and It can't be said as the member function, because friend function can't be accessed by scope- resolution, dot or arrow operators with class. void my_Guy(Gal &my_friend, std::string str_what_happn) //Friend Function Definition { my_friend.str_Nam_mood = str_what_happn; } Let's have main function regarding this Gal class. int main() { Gal aGal; aGal.disp(); my_Guy(aGal, "Have some Ferrero Rocher and Let's go Agra to see Taj!"); aGal.disp(); } //**** Saket Kr. Pathak Page 3
  • 4. C++ Friendship - Indeed what's it...? Friend Class (syntax C++) Here for explaining friend-class, Yes I am going to take help from previous example with some addition. So, there will be a forward declaration of a class who is the friend of our previous class as; class Guy; Then a bit change in Gal class as; //____Class as a Lady class Gal { friend class Guy; //friend class as a Soulmate private: std::string str_Nam_mood; public: Gal(); virtual ~Gal(); void disp(); }; Gal::Gal(): //Constructor str_Nam_mood("I not feeling good :(") {} Gal::~Gal() //Destructor {} void Gal::disp() { printf("n%sn", str_Nam_mood.c_str()); } Let's see how this class takes care of his friend who has given him complete access. He feels all the happiness that the Gal - class can imagine ... :) //___Class as a Man class Guy { public: Guy(); virtual ~Guy(); void please_change_ur_mood(Gal &dear_friend, std::string outing); }; Guy::Guy() //Constructor Saket Kr. Pathak Page 4
  • 5. C++ Friendship - Indeed what's it...? {} Guy::~Guy() //Destructor {} void Guy::please_change_ur_mood(Gal &dear_friend, std::string str_what_happn) { dear_friend.str_Nam_mood = str_what_happn; } Now main() playing as the role of life and have a definition as, int main() { Gal aGal; aGal.disp(); Guy aGuy; aGuy.please_change_ur_mood(aGal, "Let's marry again and We will visit to Rome, this time!"); aGal.disp(); return 0; } Now that's a friend having complete trust and in-dependency with all the prospective views of respect and so, ... :) ... I LOVE IT ... :) haaa haa haaa :). Hmmm :) as per principle's of the concept, we need to notice a few points as; Friendship is not mutual unless explicitly specified. (i.e. If you don’t introduce her/him to your friends, then she/he is just stranger for them and I remember a song "Don't talk to the Strangers ... Don't talk the Strangers ... Strangers Strangers" ... :) ) Friendship is not inherited. So, Inheritance stands outside here ... :) Friendship is not transitive. (It's not mandatory that, your friend will has to be a friend of your mate.) That's why I like C++. :) Ok so I don't think, It's needed to say It's completely my Prospective view to the concept which may vary from you. So don't be personal, enjoy it ... at least try ... :) Same as always take care in someone's style not mine, i used say catch you again :) Saket Kr. Pathak Page 5