Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am trying to make a breakpoint at line 33. WHen I run, the code runs through past line 33, however.


THanks,

What I have tried:

[^]
Posted
Updated 27-Dec-16 9:23am

1 solution

Probably because height is never equal to 1. But, it's impossible for us to know. We can't run your code and we don't have the data your code needs.

AGAIN!! The debugger would have told you what your code is doing. Setting the breakpoint on the if right above it and inspecting the values in the variables is the ONLY way you're going to solve this.
 
Share this answer
 
Comments
Member 12919791 27-Dec-16 15:26pm    
Just if curious, my code:
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(void)
{
int height;
int i;
int spaces1;
int blocks1;
int spaces2;
int blocks2;


do
{
printf("Height: ");
height = GetInt();
if (height==0)
{
return 0;
}

}
while
(height < 0 || height > 23);

if (height == 1)
{
for (i=0; i<1;i++)
{
for (blocks1 = 0; blocks1 < 1; blocks1++)
{
printf("#");
}

printf(" ");

for (blocks2 = 0; blocks2 < 1; blocks2++)
{
printf("#");
}

printf("\n");
}
}



else
{
for (int a=1; a<height +1; a++)
{
for(spaces1 = 0; spaces1 < height-a; spaces1++)
{
printf(" ");
}

for (blocks1 = 0; blocks1 < a; blocks1++)
{
printf("#");
}

printf(" ");

for (blocks2 = 0; blocks2 < a; blocks2++)
{
printf("#");
}

for(spaces2 = 0; spaces2 < height - a; spaces2++)
{
printf(" ");
}

printf("\n");
}

}




}
Dave Kreskowiak 27-Dec-16 15:31pm    
I'm not interested in your code.

At the same time, you are apparently not interested in learning how to code. You've been told time and time again to learn to use the debugger and you refuse to do it.

So, I refuse to help you any further.
Mohibur Rashid 27-Dec-16 16:40pm    
Why start your break point at line 32? How about starting from main function?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900