I'd need a function or code to run linux programs with arguments from my C++ program.
e.g.
"Run> someapp 1 2 3 -a -b".
Thanks for all answers!!
I'd need a function or code to run linux programs with arguments from my C++ program.
e.g.
"Run> someapp 1 2 3 -a -b".
Thanks for all answers!!
The same way you always do. Linux is nothing special in this respect:
int main( int argc, char *argv[] )
Quzah.
Hope is the first step on the road to disappointment.
That's not what I wanted to know! ;-)
My question wasn't good. I mean, I write a program like this:
int main()
{
int x, y;
cout<<"Program you want to run:";
cin>>x;
cout<<"Arguments:";
cin>>y;
<code to run x with y>
}
I hope you understand what I mean!!!
Take a look at the "exec" functions. They will do what you want. Do a "man execlp" for help.
Last edited by dmwarak; 12-27-2001 at 03:39 PM.