Monday, 26 April 2021

Friend Function in C++ Qus - 1

 

class A

{

  private:

  int a;

  A():a(10)

  {

      

  }

  friend void show();

};


void show()

{

    A ob;

    cout<<ob.a;

}

int main() {

   show();

}



No comments:

Post a Comment