티스토리 뷰
#include <stdio.h>
#define MAX_NAME 50
#define MAX_STUDENTS 100
typedef struct {
int month;
int date;
} BirthdayType;
typedef struct {
char name[MAX_NAME];
BirthdayType birthday;
} student;
student students[MAX_STUDENTS];
void strcpy(char *name, char *cname)
{
while (*name = *cname)
{
name++;cname++;
}
}
void main()
{
strcpy(students[0].name, "길동차");
students[0].birthday.month = 12;
students[0].birthday.date = 25;
printf("학생 이름 : %s 생일 %d.%d\n",students[0].name,students[0].birthday.month, students[0].birthday.date);
}
결과 :
'C > 자료구조' 카테고리의 다른 글
이중 연결 리스트 (0) | 2019.03.13 |
---|---|
원형 리스트 (0) | 2019.03.13 |
자체 참조 구조체를 이용한 동적 리스트 (0) | 2019.03.13 |
배열을 이용한 리스트 (0) | 2019.03.13 |
작동시간 코드 (0) | 2019.03.04 |