뇌를 자극하는 C프로그래밍 Exercise 9-4 문자열의 복사와 출력


뇌를 자극하는 C프로그래밍 Exercise 9-4 문자열의 복사와 출력

다음과 같이 두 개의 문자배열을 선언합니다. char str1[] = "There is no royal road to learning.";char str2[80]; str1에 저장되어 있는 문자열을 str2에 복사하여 출력하는 프로그램을 작성합니다.

프로그램을 실행하면 다음과 같이 수행될 것입니다. 복사된 문자열 : There is no royal road to learning. - 소스 #include #include int main(){char str1[] = "There is no royal road to learning."

;char str2[80]; strcpy(str2, str1); printf("복사된 문자열 : %s", str2); return 0;} - 결과...


원문링크 : 뇌를 자극하는 C프로그래밍 Exercise 9-4 문자열의 복사와 출력