C언어_구조체의 활용(배열 통째로 옮기기, 구조체 메모리 저장 형태)
·
[Programming] Language/C
- 배열 통째로 옮기기 - #include typedef struct _person //먼저 그 사람의 정보를 위한 구조체 선언. { char name[20]; char phoneNum[20]; int age; }person; int main(void) { person arr = {"한지수", "010-1717-0003", 19}; //struct person 타입의 구조체 배열 형태로 그 사람들의 정보 값을 초기화. person temp; person temp2; printf("%s %s %d\n", arr.name, arr.phoneNum, arr.age); temp = arr; //배열에다 배열 값은 못 집어넣는다. 상수 = 상수 기에 //허나, 이런식으로 그 배열값들을 다 집어 넣고 싶을때 구조체..