C에서 문자열을 연결하면 어떤 방법이 더 효율적입니까? 문자열을 연결하는 다음 두 가지 방법을 발견했습니다. 공통 부분 : char* first= "First"; char* second = "Second"; char* both = malloc(strlen(first) + strlen(second) + 2); 방법 1 : strcpy(both, first); strcat(both, " "); // or space could have been part of one of the strings strcat(both, second); 방법 2 : sprintf(both, "%s %s", first, second); 두 경우의 내용이 both될 것이다 "First Second". 어느 것이 더 효율적인지 (여러 연..