C Primer Plus 第十二章第八題

8. Here’s a part of program.

Complete the program by providing function definitions for make_array() and show_array(). The make_array() function takes two arguments. The first is the number of element of an int array, the second is a value that is to be assigned to each element. The function uses malloc() to create an array of a suitable size, set each element to indicated value, and return a pointer to the array. The show_array() function displays the contents, eight numbers to a line.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.