1.6: Save a Copy of Source File

Introduction to Programming with C++ · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    1.6: Save a Copy of Source File

    If you would like to save all the C++ programs you wrote throughout the course, normally, you don't want to save the projects you created for each program you wrote. You will only need to save the source file of your program (The file with .cpp as its file extension instead of .sln)

    Although the source file of your program is located within the project you created for the program and you can find it somewhere inside of the project folder on your computer hard drive, it is recommended to simply save a copy of the source file of your program in a convenient location such as desktop, so you can easily find it and upload it for an assignment submission.

    Here is the instructions:

    1. After you successfully execute the program, close the output window by press any key on the keyboard of your computer. The app's window remains open as following:

    Screenshot 2025-10-17 180331.png

    2. Now, lick on "File" on the Tool Bar and select "Save Source.cpp As..." shown as following:

    screenshot-3.png

    3. After clicking on "Save Source.cpp As...", navigate to the location, such as "Desktop", you may rename the file and then click on "Save"

    Screenshot-5.png

    Now, a copy of your source file is saved in the location of your choice. Please note: this is a copy of the source file of your program. You can edit it, but the change you made in this file can't be synchronized with the source file inside of the project. In other words, if you execute the program inside of the project, you will not see the changes you made on the file you saved.

    If you do want to run the file you saved, the best way to do it is to create a new project, open an empty source file in the new project. Select all the code in the saved file, copy and paste into the empty file in the new project. Then build and execute it in the new project.


    This page titled 1.6: Save a Copy of Source File was last modified on Wed, 24 Dec 2025 20:37:22 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Jin He.