(C++) Using separate files to manage a dynamic array via pointers. I have finish
ID: 3592033 • Letter: #
Question
(C++) Using separate files to manage a dynamic array via pointers.
I have finished my code but am failing some tests needed for this assignment. Below is my code (three files) and error messages.
Code:
dynamicArray.h
______________________________________________
dynamicArray.cpp
______________________________________________
dynamicArray-main.cpp
Errors:
Testing the array_constructor() function with a valid array size.
Test feedback
Invoking array_constructor() to allocate an array of size 11... Finish calling array_constructor(). Checking whether array_constructor() behaves as expected ... array_constructor() failed to construct an array!
Testing array_resize() to reduce the array's size to a negative number.
Test feedback
Invoking array_constructor() to allocate an array of size 16... Finish calling array_constructor(). Invoking array_resize() to change the size to -2... Finish calling array_resize(). Checking whether array_resize() behaves as expected ... Sorry, array_resize() failed to resize an array to -2; the array shouldn't be changed!
Testing array_resize() to reduce the size of an array.
Test feedback
Invoking array_constructor() to allocate an array of size 11... Finish calling array_constructor(). Invoking array_resize() to change the size to 4... Finish calling array_resize(). Checking whether array_resize() behaves as expected ... Sorry, array_resize() failed to resize an array!
Testing array_resize() to increase the size of an array.
Test feedback
Invoking array_constructor() to allocate an array of size 15... Finish calling array_constructor(). Invoking array_resize() to change the size to 30... Finish calling array_resize(). Checking whether array_resize() behaves as expected ... Sorry, array_resize() failed to resize an array!
Unit testkeyboard_arrow_up
Testing array_set(). Failed.
Unit testkeyboard_arrow_up
Testing mysort() to sort a randomized array in ascending order by passing your my_less_equal() function as a parameter. Failed.
Unit testkeyboard_arrow_up
Testing mysort() to sort a randomized array in ascending order by passing your my_greater_equal() function as a parameter. Failed.
Edit:
It works fine on a regular IDE, but not on more bare-bone compilers such as the one I have to submit mine on. There must be some error that more advanced IDEs overlook? My assignment is worth 32 points and it's only saying I've earned 7.
Explanation / Answer
______________________________________________
dynamicArray.cpp
______________________________________________
dynamicArray-main.cpp
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.