first one is the declaration of an object by default constructor. (google it).
second is the declaration of the object with explicit constructor. In this case you usually pass a value right away which becomes a value of the element of the class;
Class Base
{
public:
Base();
Base(int x);
private:
int number;
};
Base::Base(){
number = 0;
}
Base::Base(int x){
number = x;
}
main()
{
Base b; // First type. in this case NUMBER is equal to 0
Base b(60); // Second type. in this case NUMBER is equal to 60 but you have to pass a value to the object when you create it.
}
Something like that if I got you question correctly.
What I understand is there can be two type of context in these two type of declaration
First Context:
If you want to declare a object of class Base there can be either on declaration at a time, because both of them are same kind of declaration.
Second Context:
Create a object of class Base and if you want to declare a function which returns object of Base class then you must use different name it can't be Base b();, if you don't do so compiler will throw error that you have done a redeclaration of object b
int a; (object created on the stack and it's initial value is 0) int* a = newint; (object created dinamicaly and it's initial value is unknown)
Base a = Base(); (here right operand is temporal object and it's initial value(of it's members) is 0) Base* b = new Base; (here b is initialize with value of zerro) (it's members!) base* c = new Base(); (here c object (not pointer ) is initilized with zerro cos default constructor has been cled)
Base x(); (THIS IS WRONG AND HAS NO EFECT) just a sily declaration of some function
of course is has efect if you realy have such function defined(not declared)
as you see the is no context but just a simple rules about declaration and mermory alocation.