In C++ suppose I defined a class named Player without a default constructor.
When I creating a class instance in the main function:
Player John; The class will be created and I can see it in the debugger but the Player Adam() the class will not be created
Why the class will not be created in Player Adam(); isn't Adam() will trigger the default constructor which have no arugments ?
what is the difference between using () and not using them when there is not default constructor.
#include<iostream>
class Player{
private:
std::string name{"Jeff"};
double balance{};
public:
};
int main()
{
Player John; // the class will be created I can see it in the debugger
Player Adam();//the class will not be created
std::cout<<"Hello world"<<std::endl;
return 0;
}