Question: 5. (25 points) For this question, do not worry about error checking. Assume all inputs to functions will be valid, and no malloc errors will

5. (25 points) For this question, do not worry about error checking. Assume all inputs to functions will be valid, and no malloc errors will occur. Ignore all trivial typos (e.g., missing :) in the code below and assume it will work as intended. (25 minutes) Given the following code that implements a 2-D Cartesian coordinate system: typdef struct { int x // x-axis position // y-axis position int val // value in that position } point_t int y int main(int argc, char** argv) { int rows = atoi (argv[1]) // number of rows in the 2-D array int cols = atoi(argv[2]) // number of columns in the 2-D array // create a 2D array of point_t* point_t*** my-grid init_2d_grid(&my-grid, rows, cols) // Print out the coordinate system print-grid(my-grid, rows, cols) } void print_grid(point_t*** my-grid, int rows, int cols) { for(int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
