문자열 복사하는 방법


문자열 복사하는 방법

배열 1 2 3 4 5 6 7 8 9 10 11 12 #include<iostream> #include<string> using std::cout; using std::cin; int main() { char name[20] = "abcd"; //배열사용 char name1[20]; strcpy(name1, name); cout << name1; return 0; } cs 포인터 1 2 3 4 5 6 7 8 9 10 11 12 #include<iostream> #include<string> using std::cout; using std::cin; int main() { const char *name = "abcd"; //배열사용 const char *name1; name1 = name; cout << name1; return 0; } Colored by Color Scripter cs...



원문링크 : 문자열 복사하는 방법