2.4. Using Visual Studio¶
2.4.1. Start a Project¶
Visual Studio requires that a program be in a project, so for each program, you will need to create a new project, which it calls a C++ Console Application.
Note
This works for both C and C++ programs. There does not appear to be a project type for straight C programs.
2.4.2. Visual Studio: Prevent console application window from closing¶
You have just run your first console application in Visual Studio debug mode. But, the window closes before you can see the results!
Start without debugging
The easiest way of avoiding the problem is to start your console application from Visual Studio without using debugging. To do this, select Start Without Debugging from the Debug menu (CTRL-F5). This time when the program ends execution, the window will remain open until you press any key on the keyboard.
2.4.3. Slow from the Jump Drive¶
You will want to save your work, so you will need to save your program on a jump drive. Other students have found that loading and compiling programs stored on a jump drive can be fairly slow. So you may want to create your project on the hard drive and then copy just the source code to your jump drive. Next time you work on the project, you can create a new project and then copy the source code into the new project.