previous | start | next

Visual C++ Example

  1. Under File menu: New > File > C++ Source File

  2. Click on Location to select a directory( = folder) where the new file will be created.
  3. Type in a name for the new file; e.g., example1.cpp.
  4. Click OK.
  5. Cursor should appear in a window. Type in your program
  6. Under the Build menu, select Build.
  7. A Dialog window will ask "This build command requires an active project workspace. Would you like to create one?" Click OK.
  8. You will also be prompted to save changes to your file if you have not already. Click OK.
  9. This will try to compile and link your program to produce an executable file (named example1.exe in this case)
  10. There may be errors. These will appear in a bottom window.
  11. The error screen can be scrolled. Scroll back to find the first error in the bottom window. It will usually begin with the complete path name of your file with a line number in parentheses. Double clicking on this line will move the cursor to the corresponding line in your source code.
  12. Try to determine what the problem is, fix it, and ignore the remaining errors if any, and click on Build again.
  13. Repeat until no compilation errors are reported.
  14. To run the executable program just built, again click on the Build menu and select Execute.


previous | start | next