You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
444 B
30 lines
444 B
#include <stdio.h>
|
|
|
|
struct Point
|
|
{
|
|
int x;
|
|
int y;
|
|
};
|
|
|
|
typedef struct
|
|
{
|
|
char* brand; // 동적 할당을 위한 처리
|
|
int model;
|
|
} Vehicle;
|
|
|
|
int main()
|
|
{
|
|
struct Point pt;
|
|
pt.x = 10;
|
|
pt.y = 5;
|
|
|
|
Vehicle vc;
|
|
vc.brand = "Ford";
|
|
vc.model = 2025;
|
|
|
|
printf("pt.x: %d\n", pt.x);
|
|
printf("pt.y: %d\n", pt.y);
|
|
printf("\n");
|
|
printf("vc.brand: %s\n", vc.brand);
|
|
printf("vc.model: %d\n", vc.model);
|
|
} |