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? 
    const int SIZE = 4;
    int counter = 0;
    while(counter<SIZE) {

        // do something ...

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

        counter++;
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.