(10%) Determine
whether the following code has syntax errors or not. If
it is correct, predict its output. If it is incorrect, point out
the mistake(s).
// Inheritance
#include <iostream>
class CBox
{
public:
int m_Length;
int m_Width;
int m_Height;
CBox(int lv = 1, int wv = 2, int hv = 3): m_Length(lv), m_Width(wv), m_Height(hv) {}
int Volumn() { return m_Length * m_Width * m_Height; }
};
class CCandyBox: public CBox
{
public:
char m_Contents[12];
CCandyBox(const char *str = "Candy")
{
strcpy(m_Contents, str);
}
};
int main()
{
CCandyBox myCandyBox("Chocolate");
std::cout << sizeof(CBox) << std::endl;
std::cout << sizeof(myCandyBox) << std::endl;
return 0;
}