Вы, конечно, будете смеяться, …
… ?? ? ??????? ?? ????, ??? ????????? ????????? ? C/C++ ????? ???????????????? ??????? ??????? ????????. ????, ????????, ??? ????? ?????????:
struct foo {
int value;
};
struct bar {
int value;
};
struct foobar {
foo value1;
bar value2;
int value3;
};
?? ????? ???????????????? ??? ???:
foobar data = { { 1 }, { 2 }, 3 };
? ????? ? ???:
foobar data = { 1, 2, 3 };
?????????? ????? ??? ???????? ???? ? ?? ??????????.
PS. ?? ? ??, - ??????? ? C, ?????? ??????? ??? ? ?????????, ??-??. :-)
Cross-posted from blog.not-a-kernel-guy.com.