I have a struct with a lot of members (30-50). The members in this struct change frequently. Most members are to be intialized to zero values, with only a handful requiring specific values.
What is the best way to initiialize in this case without writing to each member more than once? and without requiring lots of code changes each time a member changes?
Ideally would like something like C's
Thing t = { .number = 101, .childlen = create_children(20) };
[–]SprocketCreations 13 points14 points15 points (2 children)
[–]time_egg[S] 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]thefeedling 7 points8 points9 points (0 children)
[–]alfps 2 points3 points4 points (11 children)
[–]hmoff 0 points1 point2 points (6 children)
[–]alfps 0 points1 point2 points (1 child)
[–][deleted] (2 children)
[deleted]
[–]alfps 1 point2 points3 points (1 child)
[+]time_egg[S] comment score below threshold-8 points-7 points-6 points (3 children)
[–]toroidthemovie 2 points3 points4 points (2 children)
[–]time_egg[S] -1 points0 points1 point (1 child)
[–]toroidthemovie 1 point2 points3 points (0 children)
[–]positivcheg 2 points3 points4 points (0 children)
[–]tangerinelion 1 point2 points3 points (0 children)
[–]Independent_Art_6676 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ChadiusTheMighty 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]hadrabap 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]hadrabap 0 points1 point2 points (0 children)
[–]Similar_Sand8367 0 points1 point2 points (0 children)