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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started