how do you make dos open a seperate file like ms paint for example
Printable View
how do you make dos open a seperate file like ms paint for example
The simplest way without knowing what exec-type functions your compiler supports would be
Code:system ( "mspaint" );
what would be the whole program code for that?
Code:...
#include <cstdlib>
...
int main()
{
...
system("[enter system call here]");
...
}
He okay i'm a newb let me tell you that. Anyway, i find this a very unclear question. Open in dos?
C:\map\map\program.exe
c.c
That would be
Note the escaping(sp?) of the backslash. I think a forward slash will work too, but I'm not sure.Code:<cstdlib>
using namespace std;
int main()
{
system("C:\\map\\map\\program.exe");
return 0;
}
http://faq.cprogramming.com/cgi-bin/...&id=1043284392
check out option 1
If you are in pure DOS or a DOS session (NOT available in XP) then you can call DOS int 21h and open a file via DOS or you can execute a dos interrupt from C which will automatically call DOS for you.
DOS has specific functions for opening child processes although they are somehwhat limited since it was never designed to be a multi-tasking OS.