I do not understand because when you create an object of the "Users" class not the message is printed containing the constructor.
class users
{
public:
users();
private:
int i;
};
users::users ()
{
cout<<"hello world";
}
int main ()
{
users users1();
return 0;
}
doesn't declare an object of the
users
class, it declares a function that takes no arguments and returns an object of theusers
class. To declare an object, use: