Question: How do I declare the following constructors in my .h file? Below was the original code. Debug Test Analyze Tools Extensions Window Help Search (Ctrl+Q)

How do I declare the following constructors in my .h file?

Debug Test Analyze Tools Extensions Window Help Search (Ctrl+Q) Local Windows DebuggerFile Edit View Git Project Build K Debug x64 list.cpp X list.h


Below was the original code.


++ Lab7 lab7.cpp (Global Scope) 52 | } 53 54 55 ///dddddddd56 57 58 59 List::List(int arr[], int size) { // Initialize the

  
 
 
 
 

Debug Test Analyze Tools Extensions Window Help Search (Ctrl+Q) Local Windows Debugger File Edit View Git Project Build K Debug x64 list.cpp X list.h ++ Lab7 lab7.cpp (Global Scope) 52 | } 53 54 55 ///dddddddd 56 57 58 59 List::List(int arr[], int size) { // Initialize the List's size to zero. mySize = 0; 60 61 // Copy elements from the array to the List. 62 63 64 for (int i = 0; i < size; i++) { myArray[i] = arr[i]; mySize++; 65 66 67 68 69 70 71 72 73 74 75 void List::removeAll(int val) { int newSize = 0; // Initialize a new size counter. for (int i = 0; i < mySize; i++) { if (myArray[i] != val) { // If the element is not equal to val, keep it in the List. myArray[newSize] = myArray[i]; newSize++; 76 77 78 79 mySize = newSize; // Update the List's size after removals. 80 108 % Error List Entire Solution 5 A O 5 Errors 0 Warnings 0 Messages 7 Build + IntelliSense Code abc E0135 Description class "List" has no member "removeAll" abc E0020 identifier "myArray" is undefined abc E0020 identifier "mySize" is undefined abc E0020 identifier "mySize" is undefined abc E0493 no instance of overloaded function "List::List" matches the specified type Error List Output Ready 0 Lab7 Sign in Live Share Solution Explorer X " Search Solution Explorer (Ctrl- Solution 'Lab7' (1 of 1 project) 4 ++Lab7 D D-O References Ln: 54 Ch: 1 SPC LF 4X Search Error List 0- Project File Line Lab7 list.cpp 68 Lab7 list.cpp 72 Lab7 list.cpp 71 Lab7 list.cpp 79 Lab7 list.cpp 57 Add to Source Control A A External Dependencies Header Files Resource Files Source Files ++ lab7.cpp ++ list.cpp hlist.h Select Repository

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!