Initialize a structure (Designated Initializers)
int aa[4] = { [2] = 3, [1] = 6 };
In a structure initializer, specify the name of a field to initialize with ‘.fieldname =’ before the element value. For example, given the following structure,
struct point { int x, y; };
the following initialization
struct point p = { .y = yvalue, .x = xvalue };
is equivalent to
struct point p = { xvalue, yvalue };
No comments:
Post a Comment
Please add your valuable feedback and suggestion...
Note: Only a member of this blog may post a comment.