employer cover photo
employer logo
employer logo

Torry Harris Integration Solutions

Aktiver Arbeitgeber

Frage im Vorstellungsgespräch bei Torry Harris Integration Solutions

Concatenating two string using pointers

Antwort im Vorstellungsgespräch

Anonym

25. Sep. 2017

#include #include #include int main() { int i,j; char *s1=(char *)malloc(100 * sizeof(char)); char *s2=(char *)malloc(100 * sizeof(char)); scanf("%s%s",s1,s2); j=strlen(s1); for(i=0;s2[i]!='\0';i++){ s1[i+j]=s2[i]; } s1[i+j]='\0'; printf("%s",s1); }

1