Visual studio 2010 exiting after program ends

前端 未结 8 837
甜味超标
甜味超标 2021-02-04 13:44

I\'m trying out Visual studio 2010 by compiling a C program. After it displays the solution in the \"DOS\" command window, the window is immediately closed. In Visual studio 200

8条回答
  •  花落未央
    2021-02-04 14:31

    After a bit of googling, I found this solution that does not involve modifying your code. It contains a workaround that involves modifying your .vcxproj file.

    To do this from within Microsoft Visual C++ 2010 Express (I'm assuming it is similar for Visual Studio 2010), open your project and navigate to the following menu:

    Project->$YOURPROJECTNAME Properties...
        ->Configuration Properties
            ->Linker
                ->System->SubSystem
    

    Then use the dropdown to select Console (/SUBSYSTEM:CONSOLE) and apply the change.

    "Start without debugging" should do the right thing now.

提交回复
热议问题