1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> // 2Â÷¿ø °ø°£ÀÇ Á¡À» ±¸Á¶Ã¼·Î ³ªÅ¸³½´Ù. struct point { int x; int y; }; int main(void) { struct point p = { 1, 2 }; // ¨ç struct point q = { .y = 2,.x = 1 }; // ¨è struct point r = p; // ¨é r = (struct point) { 1, 2 }; // ¨ê C99 ¹öÀü printf("p=(%d, %d) \n", p.x, p.y); printf("q=(%d, %d) \n", q.x, q.y); printf("r=(%d, %d) \n", r.x, r.y); return 0; } | cs |