A
Ali hamzadchsdjfhsdhfhsdjshfjsdhjfhsjfs sg gfsgsdg
Guest
#include <iostream>
using namespace std;
class abc
{
private:
int x;
public:
friend void man(abc);
void seta();
};
void abc::seta()
{
x = 3;
cout << x;
}
class bublic abc
{
protected:
int y;
public:
void setb();
};
void b::setb()
{
y = 2;
cout << y;
}
int main()
{
abc obj;
b f;
f.seta();
f.setb();
man(obj);
system("pause");
}
void man(abc g)
{
g.x = 2;
cout << g.x;
}
Continue reading...
using namespace std;
class abc
{
private:
int x;
public:
friend void man(abc);
void seta();
};
void abc::seta()
{
x = 3;
cout << x;
}
class bublic abc
{
protected:
int y;
public:
void setb();
};
void b::setb()
{
y = 2;
cout << y;
}
int main()
{
abc obj;
b f;
f.seta();
f.setb();
man(obj);
system("pause");
}
void man(abc g)
{
g.x = 2;
cout << g.x;
}
Continue reading...