C++: Semi-Colon placed before opening bracket in a while loop :     while(condition);{ 
        statement;
    }

The semi-colon before the opening bracket of the while loop shouldn't be there. The question I'm having is why the program gets stuck at the while loop during run time. As far as I'm aware the semi colon is a terminating punctuator that lets the compiler know that it has come to the end of the statement. Since it doesn't read the opening bracket of the while loop shouldn't it then move on to the next line and perform the action? If you run the debugger and move step by step, it stops moving at the while statement and will not go further. I'm just looking for some insight as to why this is the case. If it is the case that the while has to be followed by a condition and then the opening bracket why does it compile when the semi-colon is placed in between? Shouldn't some sort of error be thrown?

The IDE being used is Dev c++. I'm not sure if this is a IDE specific issue as I've not tested this in other IDEs.

