✅ 목표 (Goal)

typedef가 무엇인지 이해하자.

✅ typedef란?

type define의 약자

typedef는 자료형의 이름을 새로운 이름(별명? alias? user Label)으로 바꾸어준다.

예를 들면

typedef int integer;
typedef char character;

✅ 간단하지만 별 쓸모없는 예제

간단한 typedef 예제를 코딩해보자.

#include <stdio.h>

int main() {

	typedef int integer;
	typedef char character;

	integer a= 11;
	character c = 'A';

	printf("%c\\r\\n", c);
	printf("%d\\r\\n", a);

	return 0;
}

✅ int를 integer로 재정의할 필요가 있나? 없다!

int를 integer 혹은 정수형으로 재정의하는 것은 그다지 쓸모가 없다.

typedef int integer; // (1)
typedef int 정수형; // (2)
typedef int hihi; // (3)

(1),(2),(3) 셋다 별 의미 없다.