Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C++] Combining Strings?
#1
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.
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;
Reply


Messages In This Thread
[C++] Combining Strings? - by SoulCrusher - 04-24-2011, 04:59 AM
RE: [C++] Combining Strings? - by rootkit - 04-24-2011, 06:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)