\"Simulate\" a 2D array by a 1D array of pointers to 1D arrays Create a C++ prog
ID: 3884909 • Letter: #
Question
"Simulate" a 2D array by a 1D array of pointers to 1D arrays
Create a C++ program implementing a class that represents “ASCII art” images and operations on them, respresented as two-dimensional char arrays allocated on the heap (using the new keyword).
Create a new C++ source file named canvas.cpp that implements the Canvas class, so that canvas.cpp and the provided files compile into a program that runs with no failed tests.
The main.cpp and canvas.h are provided, these files are not to be edited only used to impement canvas.cpp file to allocate the arrays.
Only use basic c++ statements: if/else, for loops, basic arrays, allocate arrays, pointers(using *, or arrow ->), reference and dereference(using ampersand: &) ,keywords: new and delete.
main.cpp file:
canvas.h file:
Explanation / Answer
canvas.h file:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.