哇塞,终于碰到个新手呀,你说的哪个是构造函数吗?
#include<iostream.h>class aaaa{int a;int b;public:aaaa(int c)//构造函数{ a=b=c;}aaaa(int f,int g)//构造函数{a=f;b=g;}void shuchu(){ cout<<a<<b<<endl;}};void main(){ aaaa s1(3,4); s1.shuchu(); aaaa s2(5); s2.shuchu();}