Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING C AND COMMENTS! Print Matrix Trying to have a 2D array parameter in a function in C isn't as simple as in Java. Like

image text in transcribed

USING C AND COMMENTS!

Print Matrix Trying to have a 2D array parameter in a function in C isn't as simple as in Java. Like with single dimensional arrays, it's common to actually make the parameter a pointer to a pointer type rather than an actual array type. Create a function to print a 2D array of characters. Write a program that asks the user for a height and width and dynamically allocates a 2D array of those dimensions. Fill the array with dots and then randomly put asterisks in some elements. For the number of asterisks, it should be 10% of the width times the height cast to an int (for example, 10 * 10 * 0.1 = 10). Then, use the print function on the array. Here's the function header to get you startec: void print_matrix (char matrix, int height, int width) Sample Run Enter Height: 10 Enter Width: 10 Asterisk Count: 10 array (0x7f939d600000) ic

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

Students also viewed these Databases questions

Question

For what purposes are departmental reports useful to management?

Answered: 1 week ago