Interview Questions

Implement strcat in C.........

Microsoft Interview Questions and Answers


(Continued from previous question...)

126. Implement strcat in C.........

Question:
Implement strcat in C.


maybe an answer:

char *myStrcat(char *s, const char *t)
{
char *p = s;

if (s == NULL || t == NULL)
return s; /* we need not have to do anything */

while (*s)
s++;

while (*s++ = *t++)
;

return p;
}

(Continued on next question...)

Other Interview Questions