previous |
start |
next
Visual C++ Example
- Under File menu: New > File > C++ Source File
- Click on Location to select a directory( = folder) where the
new file will be created.
- Type in a name for the new file; e.g., example1.cpp.
- Click OK.
- Cursor should appear in a window. Type in your program
- Under the Build menu, select Build.
- A Dialog window will ask "This build command requires an active
project workspace. Would you like to create one?" Click OK.
- You will also be prompted to save changes to your file if you
have not already. Click OK.
- This will try to compile and link your program to produce an
executable file (named example1.exe in this case)
- There may be errors. These will appear in a bottom window.
- 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.
- Try to determine what the problem is, fix it, and ignore the
remaining errors if any, and click on Build again.
- Repeat until no compilation errors are reported.
- To run the executable program just built, again click on the
Build menu and select Execute.
previous |
start |
next