0 کاربر و 2 مهمان درحال مشاهده موضوع.
char *string1 = "cp"
char *string2 = "/home/hosein"
system ( "cp [File Name] /home/hosein" )
char* file_name = [File Name];system ("%s %s %s", string1, file_name, string2);
کد: [انتخاب]char* file_name = [File Name];system ("%s %s %s", string1, file_name, string2);
char* command = malloc( strlen("cp ") + strlen(filename) + strlen(" /home/hosein") + 1);sprintf(command, "cp %s /home/hosein", filename);sysytem (command)free(command);