Question
Programming in C with the use of argc, argv, malloc(), free(), and Makefiles Write a C program that accepts two integer numbers N and M,
Programming in C with the use of argc, argv, malloc(), free(), and Makefiles Write a C program that accepts two integer numbers N and M, dynamically allocate a two dimensional array of size N x M, and fill it (the 2D array) row by row with random integers between 1 and 10. You should define a function that takes a 2D array and an integer that represents a row in the received 2D array, this function should return the sum of all elements in that rowi. Of course, you should call this function N times to find the sum of all rows. The returned results (sum of all elements in one row of the 2D) should be stored in a corresponding cell of a result 1D array that is also dynamically allocated of size N. Another function should be written to find the maximum value in a 1D array, the array of results can be used to find the max of all sums of rows.
You should pass the size of the used array using the argc and argv of the main() function, without using scanf()
split your program over multiple C source files, different functions can be in different source files, compile each file with gcc c and then linking them using the o option. (at least three source files are required). A Makefile should be written to allow you to build, rebuild, and clean the project as it was described in class.
compiled with the (gcc) compiler under Linux.
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