Exforsys
+ Reply to Thread
Results 1 to 4 of 4

Access Specifier

This is a discussion on Access Specifier within the C and C++ forums, part of the Programming Talk category; In C++ can I declare a friend function as private. Or is it that I can declare the friend function ...

  1. #1
    cyrus is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    128

    Access Specifier

    In C++ can I declare a friend function as private. Or is it that I can declare the friend function only as public?


  2. #2
    Rahulbatra is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    124
    In the concept of Friend functions the Friend declarations generally neither refer to private nor to public functions. I think this would clarify your query.


  3. #3
    arun17 is offline Junior Member Array
    Join Date
    Oct 2010
    Answers
    6
    sure friend functions can be referred as private. Even though they are referred as private they can be defined in outside of a class.


  4. #4
    Manyamanas is offline Member Array
    Join Date
    Dec 2010
    Answers
    32
    its doesn't matter where you declare friend function just the thing is that you need to declare in each class where you want to use the private part of any class..


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...