#include "stdafx.h"
#include <iostream>
#include<conio.h>
using namespace std;
class alpha
{
private:
int data;
public :
alpha(){ data = 99; }
friend class beta;
};
class beta
{
public:
void func(alpha a)
{
cout << "function in class beta can access to class alpha so date = " << a.data;
}
};
void main()
{
alpha a;
beta b;
b.func(a);
_getch();
}
0 التعليقات:
إرسال تعليق