Microsoft Visual Studio 2017
Instructions
Microsoft Developer Network
Creating Windows Console Applications
Windows console applications get input and display
information to a command window.
We will be using this type of application for all
assignment and practical work.
Log into the PC pool
From the log in screen:
Double click Applications folder
Double click Microsoft Visual Studio 2017 folder
Double click Microsoft Visual Studio 2017
4
Creating Console Applications continued …
Creating a Project
Select the File menu
Select the New menu
Select the Project command
5
Select Visual C++ and Choose Windows Desktop
Choose Windows Desktop Wizard
Creating Console Applications continued …
Creating a Project
6
• Specify the name
of the project
• Specify the
location of the
project
• Make sure
‘Create a directory for
solution’ is selected.
• Click OK.
Creating Console Applications continued …
Creating a Project
Select Console Application (.exe)
Select Empty project and deselect other options
This creates a project that does not contain any files.
Click OK 7
Select the Solution Explorer tab if not visible
• Click the
to display
the folders (only
if they are not visible):
Header Files, Resource
Files, and Source Files.
Creating Console Applications continued …
Creating a Project
8
Creating Console Applications continued …
Adding a C source file to a project
Add a C file to the project
Select Add New Item Command from
the Project Menu
9
Select C++ File (.cpp)
Creating Console Applications continued …
Adding a C source file to a project
10
• Specify the name of the C file.
Make sure you enter the suffix .c (compile as a C program).
If not, the suffix ".cpp" is implied (compile as a C++ program) which
may cause errors.
Click the next to Source Files to see the new file
(if you can’t see it).
You may now write your C program…
Creating Console Applications continued …
Adding a C source file to a project
11
Creating Console Applications continued …
Compiling and executing your program
After you have entered your program, select the Save
command from the File menu
Compiling your program
Select the Build menu
Select the Build Solution command
12
Creating Console Applications continued …
Compiling and executing your program
Compilation messages appear in the output pane.
13
If the program compiles correctly, the following message
appears in the output pane:
1 succeeded, 0 failed
If your program is free from errors, you may now run
the program by clicking the Start Without
Debugging command from the Debug menu.
Creating Console Applications continued …
Compiling and executing your program
14
Creating Console Applications continued …
Compiling and executing your program
If your program contains syntax errors, an error
message will appear in the output pane.
When a syntax error on a particular line is reported by the
compiler, check that line for the error. Double click on the
error to take you to the corresponding line in the code. If the
cause of the error is not on that line, check preceding lines of
code for the cause of the error.
Correct the error and re-compile the program.
If the program output is incorrect you will need to
modify the source code and then re-compile the
program.
To create another application, make sure you first
select the Close Solution command from the File
menu.
15
Note:
Your programs must compile and run using Microsoft
Visual Studio C/C++ 2017.
Please ask your practical supervisor (internal students)
or your virtual classroom supervisor (external students)
for help if you are having problems with any of the above
information.
Happy coding! :)