在主函数中错误使用了test类 看看哪里的问题

#include
using namespace std;
class Test
{public:Test(int aa=1):a(aa){}
Test(){}
void putOut()const{cout<
private:int a;
static int b;
};
int Test::b=2;
void main()
{ Test t1();
t1.putOut();
const Test t2(2);
t2.putOut();
}

img

Test t1(1);,生成对象时要给予参数,当你的构造函数只有一个形参时,就算你给予了默认值,编译器也是不认识的。且Test t1();是仿函数的写法,即重载了(),不会调用无参构造函数