stdlib.hにおけるsystem関数に注意すべき点


OS:Windows
IDE:VC++6.0
 
 
 
System               

int main(void)
{
printf("About to spawn command.com and run a DOS command/n");
system("dir");   //    DOS  dir  
return 0;
} 
   system              
                    
    cmd    :  run.bat "C:/Program Files/1.txt" "D:/Test"
         ,                  :
int main(void)
{
char* command =
"run.bat /"C:/Program Files/1.txt/" /"D:/Test/"";

} 
     ,  cmd      ,         run.bat   
 
 
 cmd    C:/Program Files/1.txt   2    
           
 
 
  command              
  
 
 
char* command =
"/"run.bat /"C:/Program Files/1.txt/" /"D:/Test/"/"";
system(command);
 
 
         ,          cmd