#include #include // for malloc, free #include // for strlen, strcat // Creates a single string by concatenating all command line args. int main(int argc, char *argv[]) { // Compute amount of storage requried for result int totalLen = 0; for ( int i=0; i < argc; i++ ) { totalLen += strlen(argv[i]) + 1; // +1 for trailing blank after each token } // Allocate storage for result. // (+1 for '\0' string terminator) char *result = (char*)malloc((totalLen+1) * sizeof(char)); // Create teh result string *result = '\0'; // turn the storage just allocated into a string for ( int i=0; i