If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

linking text file C++

I have a program that reads some numbers from a table, problem is when its compiled and you run it u need to have not only the executable but also the text in the same folder in order for it to work. I was wondering if there was a way to link the text into the executable. All in one package so that you would only need one file instead of two (exe and txt)

Now that I started thinking about linking files into programs, is there a way to link programs I coded into already exixting software??? For example I write a program that everytime u open some specific software runs, or viceversa, when I run my program the other software also runs.

return 0;
}
--------------------------------------------------------------------------------
Thanx for the help, If im not mistaken ure sending here a command when u run it so what this will do is activate whatever program is put as the second parameter when running the program (argv[2]).

So basically I can also use the system commands to open up other programs while my code runs for example
-------------------------------------------------
int main(int argc, char *argv[] )
{
if(argc!=2)
cout&lt;&lt;"Syntax: run &lt;command&gt;";
else
system(argv[2]);
system(iexplorer.exe); // this would make IE open up when it runs??
return 0;
}

IE will open as long as it is on the same directory as the executable????

Q-bel - in your case it wouldn't run, or even compile. First, put "iexplorer.exe" inside of quotes. Second, at least on Windows 2K, iexplorer isn't a program in the path anywhere. Although "explorer" works fine.

BTW, they don't need to be in the same DIR at least for the MS-DOS commands or programs inside of the WinNT/System32 folder since those are all inside of the PATH variable and thus you don't need to type in the folder path - only program name.

Thanx for clearing that up about the directories, about opening up explorer that was just an example. Its just that im working on a research with a teacher I took a materials class with and I have to develop a software.Thing is, I wanted to open up (or maybe link so it would be only one executable) a simple program I developed in VB (just for the looks) from my more extensive C++ code (my strong area so its easier to do the hard parts with it). Thanx for the help guys