00001
00002 int a1[5] = { [2] = 100, [1] = 3 };
00003
00004
00005 int a2[5] = { [0] = 10, [2] = -2, -1, -3 };
00006
00007
00008 int a3[] = { 1, 2, 3, [2] = 5, 6, 7 };
00009
00010
00011 struct S {
00012 int a;
00013 float b;
00014 char c[4];
00015 };
00016
00017
00018 struct S s1 = { .c = "abc" };
00019
00020
00021 struct S s2 = { 13, 3.3, "xxx", .b = 4.5 };
00022
00023
00024 struct S s3 = { .c = {'a', 'b', 'c', '\0'} };
00025
00026
00027
00028 struct Point {
00029 int x; int y; int z;
00030 };
00031 typedef struct Point PointVector[4];
00032
00033
00034 PointVector pv1 = {
00035 [0].x = 1, [0].y = 2, [0].z = 3,
00036 [1] = {.x = 11, .y = 12, .z = 13},
00037 [3] = {.y = 3 } };