c & c++/구조체
구조체(struct)
일상코더
2022. 7. 18. 17:24
#include <stdio.h>
//사용자 정의 자료형
typedef struct _tagMyST //typedef = type을 재정의함
{
int a;
float f;
}MYST;
typedef struct _tagBig
{
MYST k; //내가 만든 자료형으로 다른 구조체에 선언 가능
int i;
char c;
}BIG;
int main(void)
{
MYST t;
t.a = 10;
t.f = 10.2121f;
int iSize = sizeof(MYST); // int + float = 8byte
return 0;
}