constructors

suppose we have a class which has both DEFAULT CONSTRUCTOR A::A() and DEFAULT ARGUMENT CONSTRUCTOR A::A(int = 0)


the default argument constructor can be called with either 1 argument or no argument.when called with no argument,it becomes default constructor.
when both these forms are used in a class, it causes ambiguity for statement such as

A a;

the ambiguity is whether to call A::A() or A::A(int = 0)


PROBLEM IS WHICH CONSTRUCTOR WILL BE CALLED???????
HELP
Neither one should be called.
It should not get past the compiler.
I salute your answer guestgulkan. Compiler should throw back a couple swear words at you and refuse to go further. If it doesn't you need to find a different compiler.
Topic archived. No new replies allowed.