Although it might seem tricky or complicated at first, it is actually a good idea to make a new project for each program. Just follow the instructions you have already learned and make sure you give each new project a meaningful name. Take time to memorize the steps.
These instructions are primarily for Visual Studio. Look for XCode, Code::Blocks and repl.it specifics at the end of each section.
If you use the menu or New Project button to start a new project, your old project might close. Read on for a way to avoid this.
You might be able to find your old projects in a "Recent Projects" list, but if you don't see it there, you can browse to it with File Explorer.
To open an old project from File Explorer, make sure you chose one of the the VC++ Project (.vcxproj) or Microsoft Visual Studio Solution (.sln) type files.
If you just open a C++ file directly, you can end up very frustrated, so only do it if you know that's what you want!!
If you already have Visual Studio open and you want to work on another C++ program at the same time, try this trick:
When you do this, you will get a new Visual Studio window to work in, and it becomes really easy to switch between
programs! Try doing this when you have lots of exercises to do for lab!
Visual Studio Projects can get pretty big and might be hard to email or put on a cloud drive. All you really need is the .cpp (C++) file from your project. You'll find it in your project folder, and it looks like this:
This is the most important part of your project to hand in to your teacher in URCourses. Do not rename it with your file browser - the IDE will lose track of it. Always rename project files with the IDE.
Windows 10 Tip: If you don't see the .cpp part of the file (the extension), click View then "File name extensions". You might also want to click Details.
General Tip: avoid using .cpp in your project name. It can cause confusion for you and your IDE.
Maybe your teacher has given you a C++ file in URCourses to help you start an assignment, or your lab instructor has given you one to download from the lab notes. Regardless of how you get it, if you ever need to add a C++ file to a new project, here is what to do:
If you do it right, your file should appear in your project's "Source Files" folder. If it isn't there, Visual Studio will not build or run your program properly. If you just open a C++ file directly, you can end up very frustrated, so only do it if you know that's what you want!!