I am really stuck here so just looking for some hints and advice. I dont know how to explain what my assignment is without actually posting what I have. So far I am only through the first bullet. I dont know where to go from there. I have read through the entire chapter again and I just dont know what parameters to pass to function drawImage and how to write the other two required functions. So, this is everything I have, I am not asking anyone to do this assignment for me, I simply want some pointers, no pun intended:
The Assignment
The objective of this program is to create an image (25 x 25) with a square of a user-defined size centered on the image.
The program will:
? Ask the user what size of square to draw (Maximum size of a side is 23, make sure to error check this entry)
? Call the function drawImage, included in the drawImage.h header file
? Call a function to print the image to the screen, using an * to demarcate the square
? Call a function that uses a pair of pointers to search through the image to determine where the edge of the square is located. This function should generate a new image that has only the outline of the square.
? Lastly recall the print function to print the image with the outline.
Submit the code as hw7-2.c
Hints:
1. Use these function prototypes
void printImage(int image[]);
void edgeDetection(int image[], int edge[]);
2. If using a one-dimension array to define a two-dimension image the following is a useful method for incrementing through the array: r + c*SIZE. Where r is the current row, c the current column and SIZE is the length of a row.
Below I have attached the given header file and what little I have written so far.
The Assignment
The objective of this program is to create an image (25 x 25) with a square of a user-defined size centered on the image.
The program will:
? Ask the user what size of square to draw (Maximum size of a side is 23, make sure to error check this entry)
? Call the function drawImage, included in the drawImage.h header file
? Call a function to print the image to the screen, using an * to demarcate the square
? Call a function that uses a pair of pointers to search through the image to determine where the edge of the square is located. This function should generate a new image that has only the outline of the square.
? Lastly recall the print function to print the image with the outline.
Submit the code as hw7-2.c
Hints:
1. Use these function prototypes
void printImage(int image[]);
void edgeDetection(int image[], int edge[]);
2. If using a one-dimension array to define a two-dimension image the following is a useful method for incrementing through the array: r + c*SIZE. Where r is the current row, c the current column and SIZE is the length of a row.
Below I have attached the given header file and what little I have written so far.