is there any way to do it.Like say I wanted to create a directory with the same name as the vaiable x.I've tried system("mkdir %s",x) but it didn't work.
is there any way to do it.Like say I wanted to create a directory with the same name as the vaiable x.I've tried system("mkdir %s",x) but it didn't work.
Last edited by angelfly; 10-05-2001 at 05:48 PM.
Use the sprintf() command to put your variables into a string, then pass that string.
The declaration of system is
int system(const char *string)
So it would stand to reason that you might be able to do something like this:
Code:char s1[20] = "MKDIR"; char s2[20] = '\0'; scanf( "%s", s2 ); strcat( s1, s2 ); system( s1 );
pointer = NULL