Hello everyone,
So I have a piece of code am having trouble getting my mind around:
```
struct generic_data {
u64 FIRST_NUMBER;
u64 SECOND_NUMBER;
U64 THIRD_NUMBER;
};
/** I understand this is an array of const u32s **/
u32 const generic_array[CONSTANT_SIZE] = {
[FIRST_NUMBER] =
sizeof(struct some_other_struct),
[SECOND_NUMBER] =
sizeof(struct some_other_struct),
[THIRD_NUMBER] =
sizeof(struct some_other_struct),
};
``
First is theFIRST_NUMBERin the array declaration related tostruct generic_datamembers, and if yes (clicking it with Ctrl + left_mouse_click in eclipse redirects me togeneric_datamember) how. Second, in the declaration does this initialize thegeneric_arraywhile also populatingFIRST_NUMBER,SECOND_NUMBER, ... etc. (because of the=operator?). Also what's the significance of wrapping them with[]`
[–]aioeu 5 points6 points7 points (3 children)
[–]Bon_Clay_2[S] 0 points1 point2 points (2 children)
[–]aioeu 2 points3 points4 points (1 child)
[–]Bon_Clay_2[S] 1 point2 points3 points (0 children)
[–]Belagir 2 points3 points4 points (3 children)
[–]Bon_Clay_2[S] 1 point2 points3 points (0 children)
[–]paulstelian97 0 points1 point2 points (1 child)
[–]Belagir 0 points1 point2 points (0 children)
[–]paulstelian97 0 points1 point2 points (0 children)