Calling an Application from Another

Hello everyone!

The title really explains what I want to do. To put into code, I want to do the following:

1
2
3
4
5
6
7
int main()
{
	// ...
	__CALL("file\path\run.exe");
	// ...
	return 0;
}


Now I think I can use System("file\path\run.exe"); but I've heard that it is not safe. Is there a better way to do it?

Thanks!

Last edited on
Why do you need to do this?
As lazy at it may sound, I have two applications, one of them is supposed to preprocess data so that the second does the real work. Now, each of these application is over 1000 lines of code, it could be easy to write a batch file that calls the first, get an output, then call the second with the output of the first. But then again, I don't want a batch file but rather an application, it's more flexible do manage conditions and, tbh, I want to be a exe.

To compromise, I'm willing to turn the first application into a DLL or a LIB, and use it in the second, though it is mysterious to me at the moment HOW I should use it...
Last edited on
It's best to make it a library. Programs don't pass data in a typesafe way.
Topic archived. No new replies allowed.