Draw circle in 2D array

Hi, as the the title states I want to draw a circle using a 2D array. I'm trying to use the Pythagorean Theorem to find all the points on the circle, but when I run the program, nothing shows up. Here is my code:
1
2
3
4
5
6
7
8
9
10
11
12
for(int r = startPR; r < startPR + radius && r < NUM_ROWS; r++)
		{
			for (int c = startPC; c < startPC + radius && c < NUM_COLS; c++ )
			{
				if ((r*r) + (c*c) == rSquared)
				{
				image[r][c].redVal = 255;
				image[r][c].greenVal = 0;
				image[r][c].blueVal = 0;
				}
			}
		}

startPR is the center point in rows(x), startPC is the center point in colums(y), rSqaured is the radius squared. The image is blank when I run the program so I assume the if statement is never computing to true. Any ideas? Thanks in advance.
The image is blank when I run the program so I assume the if statement is never computing to true.


Rather than assuming, why not find out for sure?

Put a breakpoint on it and see if the breakpoint trips.
Visual Studio gives me an error saying it cannot parse the function when I try to set a breakpoint.
Topic archived. No new replies allowed.