[7] strcpy 와 strcat


[7] strcpy 와 strcat

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #include <stdio.h> #include <string.h> int main(void) { char t[20] = "ABCDEFGHIJK"; int s = strlen(t); t[3] = '\0'; s += strlen(t); strcpy(t,"ABCDEF"); s += strlen(t); strcat(t,"ABC"); s += strlen(t); printf("%d",s); return 0; } cs 출력 결과 : 29 strcpy로 ABCDEF를 가져와서 원래 t[]를 대체한다. strcat으로 ABCDEF 뒤에 ABC를 더한다. s = 11 + 3 + 6 + 9 = 29...

[7] strcpy 와 strcat에 대한 요약내용입니다.

자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.



원문링크 : [7] strcpy 와 strcat