send arrays of two objects to friend function
Hi,
I make two class in my program and make 50 objects for every class by arrays.
Is It true ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
const int n=50
const int m=50
Class b;
Class a
{
.
.
.
friend void doost(a objrect[],int n,b objtriang[] int m);
};
Class a;
Class b
{
.
.
.
friend void doost(a objrect[],int n,b objtriang[] int m);
};
int main()
{
.
.
.
doost(myrect , n,mytriangle,m);
}
void doost(a objrect[],int n,b objtriang[] int m);
{
.
.
.
}
|
I do not see where the arrays were declared.
Now I edit it .Are there any problems in it?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
const int n=50
const int m=50
Class b;
Class a
{
.
.
.
friend void doost(a objrect[],int n,b objtriang[] int m);
};
Class a;
Class b
{
.
.
.
friend void doost(a objrect[],int n,b objtriang[] int m);
};
int main()
{
a myrect[n];
b mytriangle[m];
.
.
.
doost(myrect , n,mytriangle,m);
}
void doost(a objrect[],int n,b objtriang[] int m);
{
.
.
.
}
|
Last edited on
Topic archived. No new replies allowed.