-1
下面的類聲明有什麼區別?A a有什麼區別?和A a();?
class A
{
public:
A()
{
std::cout << "A()\n";
}
~A()
{
std::cout << "~A()\n";
}
};
int main(int argc, char *argv[])
{
A a; // <-- this call the constructor and destructor
A b(); // <-- this is not!! what is a b()?
return 0;
}
什麼是b()
?
請不要回答明顯的錯誤 – NathanOliver