Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q6: Find 6 errors in the following code and fix them. Member variable count will be used to keep track of number of objects created
Q6: Find 6 errors in the following code and fix them. Member variable count will be used to keep track of number of objects created for class Test. #include using namespace std; class Test { int x; char yi int count; void Test (int i=0, char b); public: Test (Test A) { x = A.X; y = A.y; count++; } ~Test() { count--; } }; void Test (int i, char b) { X = i; y = b; count++; } int main() { Test X, Y; return 0; }
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