Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are 8 different run-time and compile-time errors in the following C++ program. Identify each error by writing down a) a line number, b) a
There are 8 different run-time and compile-time errors in the following C++ program. Identify each error by writing down a) a line number, b) a description of the error and c) a suggested fix. For example, line 15: address is a private data member; fix: obj. setAddress("70 The Pond"); Note: Copying and pasting compiler error messages will result in a mark of zero for the error that you have identified. 0001 #include 0002 #include 0003 class Name{ 0004 char* m_value; 0005 public: 0006 Name() { m_value = nullptr; stropy(m_value, "Hi"); } 0007 Name(char* s) { m_value = new char[strlen(s)]; 0008 strcpy(m_value, s); } 0009 void print() const { cout print(); cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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