better way to concatenate multiple strings in c?

Is there a better way to concatenate multiple strings together in c other than having multiple calls to strcat() all in a row, like below?

char prefix[100] = "";
strcat(prefix, argv[0]);
strcat(prefix, ": ");
strcat(prefix, cmd_argv[0]);
strcat(prefix, ": ");
strcat(prefix, cmd_argv[1]);
perror(prefix);
23
задан user738804 4 May 2011 в 21:07
поделиться