I dont want console to appear when i run c++ program

后端 未结 7 893
时光取名叫无心
时光取名叫无心 2021-02-07 11:24

I want to write one c++ program, compiling and linking .cpp gives .exe file. if i double click on that and execute it a console gets opened and closed. I don\'t want that consol

7条回答
  •  不要未来只要你来
    2021-02-07 11:39

    On CODEBLOCKS, besides what @ravenspoint said, you have to put this line on your first line of code:

    #define _WIN32_WINNT 0x0501 //this is for XP
    

    And then:

    ShowWindow (GetConsoleWindow(), SW_HIDE);
    

提交回复
热议问题