Question: c++] is it true or false that a class must have a default constructor defined in the definition of the class? given the following class
c++] is it true or false that a class must have a default constructor defined in the definition of the class?
given the following class definition, how would you declare an object of the class, so that the object
automatically called the default constructor
class ItemClass
{
public:
ItemClass();
ItemClass(int newSize, float newCost);
int getSize();
float getCost();
void setSize(int newSize);
void setCost(float newCos);
private:
int size;
float cost;
};
a.temClass() myItem;
b.ItemClass myItem(1, 0.0);
c.ItemClass myItem;
d.ItemClass myItem();
e.
You can not do this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
