Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

notes:

You should 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.

and compiled with the (gcc) compiler under Linux.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

What three processes occur in every heat engine?

Answered: 1 week ago

Question

6. How likely are children to heed such advice? Why?

Answered: 1 week ago

Question

design a simple performance appraisal system

Answered: 1 week ago