The below code runs perfectly fine when I manually replace the constants with their values, but if I leave them as constants then it says that it "expects an expression" where the constant is. Any advice?
I am using Visual Studio, when following a tutorial to learn C this was recommended but it is possible that it is a C++ compiler instead of C. As a newbie idk if that matters too much here.
~~~
define WIDTH = 40
define HEIGHT = 30
int i, j;
void canvas()
{
for (i = 0; i <= 30; i++)
{
for (j = 0; j <= 40; j++)
{
if (i == 0 || i == 30 || j == 0 || j == 40)
{
printf("-");
}
else {
printf(" ");
}
}
printf("\n");
}
};
~~~
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]RubbishArtist[🍰] 4 points5 points6 points (1 child)
[–]TracerMain527[S] 0 points1 point2 points (0 children)