Pretty much, except I added the closing brace for the for loop...

On Mon, Mar 2, 2009 at 5:37 PM, Paul Herring <[email protected]> wrote:

>    On Mon, Mar 2, 2009 at 11:03 PM, Michael Sullivan 
> <[email protected]<msulli1355%40gmail.com>>
> wrote:
> > if I step through it with F10 it works correctly, but if I don't, it
> > doesn't, and at the end of the run x is still 0.  Is this a problem with
> > VC++ or a problem with my code.  I'm trying to figure out a formula for
> > displaying sprites in 3 columns of four rows each.  Does anyone know a
> > formula for that that doesn't involve the above method?
>
> #include <iostream>
> int main(void){
> int x, y;
> for (int i = 0; i < 12; i++){
> x = 0;
> y = 0;
> if (i >= 4 && i < 8){
> x = 100;
> }
> if (i >= 8 ){
> x = 200;
> }
> }
> std::cout << "x=" << x << " y=" << y << std::endl;
> }
>
> Works as expected here - was that a direct copy/paste of your test code?
>
> --
> PJH
>
> http://shabbleland.myminicity.com/ind
> http://www.chavgangs.com/register.php?referer=9375
>
> 
>


[Non-text portions of this message have been removed]

Reply via email to