구조체의 정의

Study Log/자료구조

[자료구조] 구조체의 정의와 선언 및 초기화

구조체(Structure) : 서로 다른 자료형의 데이터를 하나의 그룹으로 묶은 자료형 구조체의 선언 struct student{ char name[20+1];//+1은 null문자를 추가해준 것. intnum; float grade; } 구조체의 초기화 방법 1) 구조체의 초기화 방법 2) 값 설정 struct student student_lee = {"lee",2004153648, 92.5}; struct student student_lee={0}; strcpy(student_lee.name,"lee"); student_lee.year = 2004153648, student_lee.grade = 92.5; 구조체 변수의 복사(값 복사) struct student lee_src = {"lee",2004..

개발하는 채찡
'구조체의 정의' 태그의 글 목록