Return to Topic Menu | Computer Science Main Page | | Terms of Use | Resource CD


Getting Your Pre-existing File INTO Your Project So That It Can Be Accessed

You are ready to write a program to access an existing data file.  You have established a project, have coded the C++ program, and are about to build your program.  


Before you build that program, be sure that the data file you wish to access is IN the project.  The following steps will be the easiest way to "push" the data file into your project AND have it appear in your workspace window on the left for easy access. 

Do these steps BEFORE you build your program:

1.  Go to FILE/NEW
2.  Choose text file.
3.  Name the file what you wish it to be for this program (it will be empty).  It will now appear in the workspace on the left.
4.  Find the data file that you plan to use.  It will most likely be in another project folder.  Double click to open it in your editor window.
5.  Highlight this file and copy to clipboard.
6.  Click on the empty file in the workspace window on the left to open it.
7.  Paste your file into this empty editor.
8.  Save workspace.

The file appearing in your workspace window on the left is now your desired data file for this project and will remain with this project.


You can also try, from the toolbar, <Project> <Add to Project> <Files> and search for your data file.  This process, however, has been very troublesome on a Windows NT network, as well as several individual machines.  While the file appears in the workspace, it is not accessed.