
Write a function that fills an output array with the sum of each row of a 2D grid whose rows are exactly four integers wide.
int grid[2][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}}; row_sums(grid, 2, out);10 26int grid[3][4] = {{1, 2, 3, 4}, {10, 20, 30, 40}, {100, 200, 300, 400}}; row_sums(grid, 3, out);10 100 1000int out[3] = {-1, -1, -1}; row_sums(grid, 0, out);-1 -1 -1row_sums.c<stddef.h>defines size_t
Run the tests to grade your code
Write a function that fills an output array with the sum of each row of a 2D grid whose rows are exactly four integers wide.
int grid[2][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}}; row_sums(grid, 2, out);10 26int grid[3][4] = {{1, 2, 3, 4}, {10, 20, 30, 40}, {100, 200, 300, 400}}; row_sums(grid, 3, out);10 100 1000int out[3] = {-1, -1, -1}; row_sums(grid, 0, out);-1 -1 -1row_sums.c<stddef.h>defines size_t
Run the tests to grade your code
Memory will appear here