T
toton
Hi,
Which one is the correct syntax for constructor for static memory
allocation
Object obj("param");
or
Object obj = Object("param");
1) For the first one, how compiler checks it as not a function
deceleration rather than ctor call?
2) For the second one, is the assignment op is also called? If so, how
to remove such assignement call? (like, object initialization with new,
which do not need an assignment operator)
3) If I do not declare explicit in the ctor, will it convert all
premitive type to the matching ctor?
e.g Object obj = "hello"; will it convert "hello" to a char* matching
ctor if found? Is it true for multiple arguments also?
thanks
Which one is the correct syntax for constructor for static memory
allocation
Object obj("param");
or
Object obj = Object("param");
1) For the first one, how compiler checks it as not a function
deceleration rather than ctor call?
2) For the second one, is the assignment op is also called? If so, how
to remove such assignement call? (like, object initialization with new,
which do not need an assignment operator)
3) If I do not declare explicit in the ctor, will it convert all
premitive type to the matching ctor?
e.g Object obj = "hello"; will it convert "hello" to a char* matching
ctor if found? Is it true for multiple arguments also?
thanks