I'm pretty sure I have the logic of this problem figured out, but I have spent two weeks working every day struggling to get my code to compile so that I can actually test what I've done. I keep getting errors that I know are stupidly simple, but I've tried everything and now I need help. Anyone who could look at my code and explain where I am going wrong in my formatting or whatever it is would be greatly appreciated. I've read through all the recommended reading for week 1 and watched all the lectures and walkthroughs and shorts and this just isn't sticking. Right now this code is giving me:
error: unused variable 'l' and
error: unused variable 'c'
Does this have something to do with the scope of the variables? I thought I declared them in the correct place but now I'm confused...
int main(void)
{
int h = 0, l = 0, c = 0;
do
{
printf("Please give me an int between 0-23:/n");
h = GetInt();
}
while (h < 0 || h > 23);
return 0;
for(int l = 0; l < h; l++)
{
for(int c = 0; c < h; c++)
{
printf("%s", " ");
}
for(int c = 0; c < h+2; c++)
{
printf("#");
}
printf("\n");
return 0;
}}