Q:

Assuming the Sales_data constructors are not explicit, what operations happen during the following definitions

0

Assuming the Sales_data constructors are not explicit, what operations happen during the following definitions

string null_isbn("9-999-99999-9");
Sales_data item1(null_isbn);
Sales_data item2("9-999-99999-9");

What happens if the Sales_data constructors are explicit?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

If the constructors are not `explicit`.

string null_isbn("9-999-99999-9");  // call string ctor
    Sales_data item1(null_isbn);  // call Sales_data ctor
    Sales_data item2("9-999-99999-9");
    // first cover "9-999-99999-9" to string, then call Sales_data ctor

If the constructors are `explicit`, the same operations happen.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now