Programming/C, C++ (11) 썸네일형 리스트형 타입변환과 구조체TIP typedef struct Player { int level; char name[20]; int hp; int mp; }PLAYER; 이런식으로 선언하면 typedef struct Player PLAYER; 를 따로 써줄 필요가 없어진다. 타입변환 typedef 형태 typedef 자료형 새로운자료형; 예시) typedef int NEWTYPE; NEWTYPE a=10; printf("%d\n", a); --출력-- 10 구조체 형태 struct 구조체명 { }; 예시 #include struct Player { int first; int second; int third; }; void main() { struct Player you; // Player 구조체를 지역변수 you로 만든것 you.first; // Player구조체를 갖는 you의 first를 가져오는것 } 이전 1 2 다음