I need help in figuring out a syntax error I have in my code. I've been playing around with it and still have not figured out exactly how to fix the syntax error.
Code:
#include "stdafx.h"
#include "stdio.h"
/*Objective: To implement a simple drawing program. The program will
draw on the screen a series of figure(boxes). It will repeatedly ask
the user to enter the loaction and dimensions.*/
int main()
{
char mat[20][40];
int col, row, x, y, width, height;
int stop=0;
int letter=3;
for(row=0;row<20;row++)
{
for(col=0;col<40;col++)
{
mat[row][col]='.';
}
}
do
{
printf("Enter x0, y0, width, height:");
if(scanf("%i%i%i%i",&x,&y,&width,&height)==EOF)
{
stop=1;
}
else
{
printf(" 0000000000111111111122222222223333333333\n");
printf(" 0123456789012345678901234567890123456789");
for(row=0;row<20;row++)
{
if (row<10)
{
printf("0%d", row);
printf("\n");
}
else
{
printf("%d", row);
printf("\n");
}
for(col=0;col<40;col++)
{
if((col==x)||(col==(x+width-1))||((row==y)||(row==(y+height-1))))
{
if((col>=x)&&(col<=(x+width-1))&&((row>=y)&&(row<=(y+height-1))))
{
mat[row][col]=letter;
printf("%c",mat[row][col]);
}
if(col==39)
{
printf("\n");
}
}
}
}
}
letter++;
}
while(!stop);
for(;;);
return 0;
}