class A
{
private:
int a;
void display()
a=10;
cout<<"Display"<<endl;
}
friend void show();
};
void show()
A ob;
cout<<ob.a<<endl;
ob.display();
int main() {
show();
Output
Garbage Value
Display
10
No comments:
Post a Comment