TIL:구조체

구조체

ex) 구조체 작성

struct example{
	int x1;
    char y1;
};

ex) 구조체 변수 선언

	struct example ex1;
    ex1.x1 = 10;
    ex1.y1 = 'a';

ex) 구조체 배열 선언

struct example ex[5];

ex[0].x1 = 10;
ex[0].y1 = 'b';
...
ex[4].x1 = 50;
ex[4].y1 = 'e';

ex) 구조체 포인터

struct example* pointer = NULL;
pointer = &ex[0];
pointer->x1 = 30;