I am trying to come up with my own code for strcat. This is what I have so far. I'm getting a segmentation fault and i can't figure out why. The function prototype and call must not change. Any suggestions?
//Function Protoype
char* stringCat(char *pWord, char *pTemp);
//Function call in main
stringCat(stringCat(word, ": "), temp);
printf("\n\nConcatenation: \"%s\".", word);
printf("\n\n");
//Actual Function
char* stringCat(char *pWord, char *pTemp)
{
int i;
int j;
for (i = 0; pWord[i] != '\0'; i++)
for (j = 0; pTemp[j] != '\0'; j++)
pWord[i+j] = pTemp[j];
pWord[i+j] = '\0';
return pWord;
}