Could anyone help me figure out why I can not compile, but get the following error:
~/workspace/pset1/mario/less/ $ make mario
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11
-Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable
-Wshadow mario.c -lcrypt -lcs50 -lm -o mario
when trying to compile:
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int height;
int spaces;
int hash;
do
{
printf("Please choose a height from 0 to 23");
height = get_int("height:");
}
// Promt and loop if not between 0-23
while (height <= 0 || height >= 23);
for (int i = 1; i <= height; i++)
{
// To print out spaces
for (spaces = (height - i); spaces >=0; spaces--)
{
printf(" ");
}
// To print out hashes
for (hash = 1; hash <= (i + 1); hash++)
{
printf("#");
}
printf("\n");
}
return 0;
}
Thanks!