#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct employee {
char name[10];
int year;
int pay;
}; //lee, kim;
void main()
{
struct employee lee;
struct employee kim;
struct employee* leeptr = &lee;
struct employee* kimptr = &kim;
leeptr->year = 2015;
kimptr->year = 2014;
if (leeptr->year > kimptr->year)
printf("lee is senior\n");
else
printf("kim is senior\n");
}
'Program language > C' 카테고리의 다른 글
[C] 노트필기 (0) | 2021.04.12 |
---|---|
[C] 데이터를 구조체로 반복해서 입력받고 출력하기 (0) | 2021.04.05 |
[C] 구조체 화살표 연산자 이용하기 (0) | 2021.04.05 |
[C] 구조체 선언 후 구조체 멤버 초기화하고 출력하기 (0) | 2021.04.05 |
[C] 구조체 선언과 초기화 (0) | 2021.04.05 |