Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

student submitted image, transcription available below


Below was the original code.


student submitted image, transcription available belowstudent submitted image, transcription available below   
 
 
 
 

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

LO9 develop a basic understanding of the concept of goodwill (13.9)

Answered: 1 week ago