Thursday, July 30, 2009

How to write and compile a c++ program in Microsoft Visual Studio?

Launch Visual C++


Select File \ New \ Project \ Win32 Console Application


Enter a project name (anything you want)


Click OK


Then check "a typical hello world application" and hit finish.





The wizard will create a bare bones hello world app for you.


The project will start with focus on the class view. Select "File View" tab (bottom left) to look at the files it created.





To compile, Select Build menu and 'build .___.exe", or just hit F7. You can experiment with adding your own code to the hello world app and recompiling.





To debug your exe, do a debug build. You may have to right click on the top ribbon and add a check mark to 'build' to show the build options menus. Select Win32 Debug from the dropdown, recompile. To debug, select Build menu\Start Debug\Go (or just hit F5)





To set breakpoints, click on a line of code and hit F9





Good luck!

How to write and compile a c++ program in Microsoft Visual Studio?
Have you installed Visual Studio yet?





First create a new project, then start coding, then hit f5 to test/debug or hit ctrl + f7 to build and compile.
Reply:Create a new project with wizard (console, with mfc, without mfc, with atl support.. or only with windows sdk) and press F5 to run the project..


No comments:

Post a Comment