2

while(1) ;
Std::cin.get()

I am tired of these when learning cpp. Unnecesary rant!

Comments
  • 0
    What's the question?
  • 0
    @RememberMe I was ranting but have choosen wrong type of post. Question: Why some developers are technology impaired?
  • 0
    @aviophile ah that wasn't particularly clear from the post.

    Also, eh?
  • 0
    Basicly, i was tired of adding one of these statements at the end to hang the program console so it does not shut down.
  • 0
    @aviophile yeah I agree that gets pretty annoying. I use a debug macro that the compiler defines when compiling in debug/release mode to switch it on or off automatically when using Visual Studio.

    VS defines the _DEBUG macro when in debug mode, you can use this to automatically switch on/off the cin.get()

    Similar tricks for other compilers (I think NDEBUG macro is portable)
  • 0
    then use an external cmd instance and start it from there

    or simply write only std::cin.get(); there isn't really any point in that infinite while thingy
  • 0
    @s0LA that's pretty much what I was saying too.
  • 0
    @Krokoklemme you dare tell me leave visual studio play button and use command line like peasants? Never!
Add Comment