char* StrCat(char* dest, char* source)
{
char* retVal = dest;
while(*dest)
dest++;
while(*dest++ = *source++) ;
return retVal;
}
int main()
{
char* a = "One";
char* b = "Two";
char* x = StrCat(a, b);
printf("%s\n", x);
return 0;
}
The program crashes the first time when copying from source to destination, second while loop. (Access violation
error)