Hi I'm supposed to write a program that has the input include:
• m lines, each including n characters. If the character read is not a space, the character belongs to the boundary of the shape.
• Two numbers that specify the coordinates, namely the row and column indices of the point from which the program is supposed to start filling the shape.
I started doing it but when i got to the fill function I can't think of anything to put in it. Here is what i have so far.
#include <stdio.h>
#include "simpio.h"
void getlength(int row, int column);
void getshape(int row, int column, char shape[][]);
void fill(int row, int column, char shape[][]);
void returnResult(char result);
int main()
{
int row, column;
getlength(row, column);
char shape[row][column];
getshape(shape);
fill(row, column, shape);
char result;
returnResult(result);
getchar();
return 0;
}
void getlength(int row, int column)
{
printf("Enter the number of rows\n");
row=GetInteger();
printf("Enter the number of columns\n");
column=GetInteger();
}
void getshape(int row, int column, char shape[][])
{
char end='.';
printf("Enter a shape and when your done enter '.'\n");
while ((end=getchar()) != '.')
{
shape=getchar();
}
}
void fill(int row, int column, char shape[][])
{
// cant think of anything
}