How would I put a variable in a system command.. like SYSTEM("talk VARIABLE")
??
Do I need a string?
Pls help thanks.
How would I put a variable in a system command.. like SYSTEM("talk VARIABLE")
??
Do I need a string?
Pls help thanks.
Use sprintf( ).
Code:#include <cstdio> #include <cstdlib> int main( void ) { char *aString = "Hello"; char buffer[ 256 ]; sprintf( buffer, "test %s", aString ); system( buffer ); }
Last edited by XSquared; 05-29-2003 at 05:14 PM.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Would someone mind elaborating a little on that? Ive read up and cant get it.
Sorry im blind