I've got a problem with something I'm programming. I get this error over and over;
jharvard@appliance (~/Dropbox/pset1): make mario
clang -ggdb3 -O0 -std=c99 -Wall -Werror mario.c -lcs50 -lm -o mario
mario.c:23:5: error: expected identifier or '('
do
^
mario.c:32:1: error: expected identifier or '('
do
^
2 errors generated.
I searched all over the internet but couldn't find the problem..
removing the ; after int main(void)
didn't help
This is my code:
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main(void);
//Ask User for Height, and check
int a, b, rows, height;
int a = 0;
int b = 0;
int rows = 1;
do
{
printf ("Height: ");
height = GetInt();
}
while (height <=0 || height > 23);
//build half pyramid
do
{
do
{
printf("r");
a++;
}
while (a < height - rows);
do
{
printf("#");
b++;
}
while (b < rows + 1);
printf("\n");
rows++;
while (rows <= height);
}
I've been trying to solve this problem for a few days, but i just can't figure it out!
Thank you so much in advance!