Skip to content

Commit

Permalink
strcat 구현
Browse files Browse the repository at this point in the history
strcat 구현
  • Loading branch information
hyejun0608 authored Jun 17, 2020
1 parent e1b2175 commit 3eddfad
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions strcat 구현.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

void strcat(char* dest, char* src) {
int i, j;
for (i = 0; dest[i]; i++);
for (j = 0; src[j]; j++) {
dest[i + j] = src[j];
}
dest[i + j] = '\0';
}

int main() {
char dest[100], src[100];
gets(dest);
gets(src);
strcat(&dest, &src);
printf("%s", dest);
}

0 comments on commit 3eddfad

Please sign in to comment.