Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++, using visual studios. I'm stuck, can someone please help me with my code for the failed messages. For the Append, and Reserve. I
In C++, using visual studios. I'm stuck, can someone please help me with my code for the failed messages. For the Append, and Reserve. I have attached a screenshot of the fail messages.
32 33 // Main toggle 34 35 36 37 38 39 #define LAB_1 1 // Individual unit test toggles #define #define #define LAB1_BRACKET_OPERATOR LAB1_DEFAULT_CONSTRUCTOR_NO_ARGS LAB1_DEFAULT_CONSTRUCTOR_WITH_ARGS 1 1 1 40 #define LAB1_SIZE_ACCESSOR 1 41 #define LAB1_CAPACITY_ACCESSOR 1 42 #define LAB1_RESERVE_EMPTY 1 43 #define LAB1_RESERVE DOUBLE_CAPACITY 1 44 45 #define LAB1_RESERVE LARGER_CAPACITY #define LAB1_RESERVE SMALLER_CAPACITY 1 1 46 #define LAB1_APPEND_NO_RESIZE 1 47 #define LAB1_APPEND_RESIZE 1 48 #define LAB1_CLEAR 1 49 #define LAB1_DESTRUCTOR 1 50 #define LAB1_ASSIGNMENT OPERATOR 51 #define LAB1_COPY_CONSTRUCTOR 1 52 53 54 55 56 57 58 59 60 61 62 63 64 // Our implementation of a vector (simplified) template class DynArray { // Gives access to test code friend class UnitTests Lab1; // Data members // NOTE: All values set to -1 for unit test purposes Type* nArray = reinterpret_cast (-1); size_t mSize = -1; size_t mCapacity = -1; 65 66 public: 67 68 69 70 71 72 73 74 75 { 76 77 DynArray(size_t startingCap = 0) { // TODO: Implement this method = mArray nullptr; mSize = 0; mCapacity = 0; if (startingCap > 0) mArray = new Type [startingCap]; mCapacity startingCap; 78 79 80 81 -DynArray() { 82 // TODO: Implement this method
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