04-24-2011, 04:59 AM
I need to know how to put multiple previously declared strings together to form a system command in a console application. I can get a SINGLE "string" to work, but how can I have 3 put together, declared by input?
Also needs to work with other text that ISN'T declared by input.
This is what I have so far, don't bother commenting on it, I'm a complete noob to this.
Also needs to work with other text that ISN'T declared by input.
This is what I have so far, don't bother commenting on it, I'm a complete noob to this.
Code:
char myArray[75];
char myArray2[75];
char myArray3[75];
cout << "Please enter the directory of the first file to bind: ";
cin.getline( myArray, 75, '\n');
cout << "Please enter the directory of the second file to bind: ";
cin.getline( myArray2, 75, '\n');
cout << "Please enter the directory of the output file: ";
cin.getline( myArray3, 75, '\n');
system("copy /b", myArray, " + ", myArray2, myArray3);
system("PAUSE");
return EXIT_SUCCESS;