How would I put a variable in a system command.. like SYSTEM("talk VARIABLE")
??
Do I need a string?
Pls help thanks.
Printable View
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 );
}
Would someone mind elaborating a little on that? Ive read up and cant get it.
Sorry im blind