0

so if I have const int SIZE = 4; and a while loop

const int SIZE = 4;
int counter = 0;



    while(true) {

      // do something ...

      if(SIZE == counter+1) {cout << "Hello world"}



    }

 why is this not working? and how is the right way to do it? 
2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by AndrisP
0
    const int SIZE = 4;
    int counter = 0;
    while(counter<SIZE) {

        // do something ...

        if(SIZE == counter+1) { cout << "Hello world"; }

        counter++;
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.