No no, while(!gameover) does NOT set game over to false. It is saying "while gameover is equal to false". This is CHECKING its value, not SETTING it. You could exactly equivallently write while(gameover==false) . Note the double '=', this is c++ for "comparison".
DO NOT do while(gameover=false) . This DOES set gameover to false and this will DEFINITELY not work as you expect.