Visual studio 2010 exiting after program ends

前端 未结 8 681
甜味超标
甜味超标 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:34

    The reason this happens is because now in VS 2010 it is possible to create an empty, generic C++ project by default, without having to go through the wizard. This causes VS 2010 to not properly set the Console (/SUBSYSTEM:CONSOLE) flag and so VS2010 has no idea it is a console application for which it would send the usual "Press any key..." prompt.

    This problem doesn't occur if you create a Console Application project type from the New Project menu.

    But then you can set this flag yourself and many others, through Project/Settings, as the above post has answered correctly!

提交回复
热议问题