형태
struct 구조체명 { };
예시
#include
struct Player
{
int first;
int second;
int third;
};
void main()
{
struct Player you; // Player 구조체를 지역변수 you로 만든것
you.first; // Player구조체를 갖는 you의 first를 가져오는것
}
'Programming > C, C++' 카테고리의 다른 글
구조체크기할당조절 pragma pack (0) | 2020.02.05 |
---|---|
열거형 enum (0) | 2020.02.05 |
#if ~ #endif (0) | 2020.02.04 |
타입변환과 구조체TIP (0) | 2020.02.04 |
타입변환 typedef (0) | 2020.02.04 |