-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
struct Point | ||
{ | ||
int x, y, z; | ||
}; | ||
|
||
struct Outer { | ||
struct Point p; | ||
}; | ||
|
||
int main() | ||
{ | ||
// Examples of initialization using | ||
// designated initialization | ||
struct Point p1 = {.y = 0, .z = 1, .x = 2}; | ||
struct Point p2 = {.x = 20}; | ||
struct Outer o = {.p.x = 10}; | ||
int foo2[10] = { [3] = 1, [5] = 2 }; | ||
|
||
// This only works in C (!!) | ||
int foo3[10] = { [0 ... 9] = 2 }; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters