qq_45813272
2021-01-18 21:10c++ 程序改错 求大佬解答
#include <iostream>
class A
{int a,b;
public:
A(int x,int y);
void display();
friend void show(A t);
};
A::A(int x,int y)
{a=x;b=y;}
void display()
{cout<<a<<endl;
}
void show(A t)
{
cout<<t.b<<endl;
}
void main()
{
A temp(1,2);
temp.display();
temp.show(temp);
cout<<temp.a<<endl;
}
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- C++程序改错求 大佬帮忙
- c++
- 2个回答