Question: For this prelab, you will practice using pointers, pass - by - reference, and multi - dimensional arrays in C programming. You will create a
For this prelab, you will practice using pointers, passbyreference, and multidimensional arrays in C programming. You
will create a program that prints a diamond shape using characters. The character changes when the program switches
to a different row, and this character is passed by reference and modified by a function.
Instructions:
Create a function to modify the character:
o The function should take a pointer to a character as an argument and modify it
o The character should be incremented to the next ASCII character.
Create a function to print the diamond:
o The function should take the size of the diamond an integer and a pointer to the starting character.
o The function should use a D array to store the characters of the diamond shape.
o The function should call the character modification function each time it switches to a different row.
Main function:
o The main function should prompt the user for the size of the diamond and the starting character.
o The main function should call the diamond printing function with the appropriate arguments.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
