What are friend classes?

Discussion in 'C++' started by Snyke, Aug 5, 2004.

  1. Snyke

    Snyke Guest

    Hi.
    I'm just wondering what friend classes/functions are.
    It's because I stumbled across them while analyzing a source.
     
    Snyke, Aug 5, 2004
    #1
    1. Advertising

  2. Snyke wrote:
    > I'm just wondering what friend classes/functions are.
    > It's because I stumbled across them while analyzing a source.


    If a function declared a friend you may access private members of
    the class inside the body of that function. Declaring a whole class
    a friend grants access to private members inside the scope of that
    class.

    Victor
     
    Victor Bazarov, Aug 5, 2004
    #2
    1. Advertising

  3. Snyke

    rossum Guest

    On 5 Aug 2004 08:04:21 -0700, "Snyke" <> wrote:

    >Hi.
    >I'm just wondering what friend classes/functions are.
    >It's because I stumbled across them while analyzing a source.


    Read the FAQ for a quick introduction to friends:
    http://www.parashift.com/c -faq-lite/

    rossum


    --

    The ultimate truth is that there is no Ultimate Truth
     
    rossum, Aug 5, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z f
    Replies:
    0
    Views:
    305
  2. Alexander Stippler

    nested classes and friend declaration

    Alexander Stippler, Jul 2, 2003, in forum: C++
    Replies:
    1
    Views:
    398
    Victor Bazarov
    Jul 2, 2003
  3. Adam Parkin
    Replies:
    6
    Views:
    529
    Victor Bazarov
    Apr 24, 2004
  4. Srini nandiraju

    friend classes

    Srini nandiraju, May 19, 2004, in forum: C++
    Replies:
    5
    Views:
    2,610
    David White
    May 19, 2004
  5. Peter
    Replies:
    2
    Views:
    296
    Öö Tiib
    Jun 6, 2013
Loading...

Share This Page