I'm preparing for C++ institute exam. One of the questions is below. The outcome is 34 but I can't figure out why. I don't know how to approach this. Any body any idea how to solve this without a compiler (reason it out)?
str is an aggregate object containing an array of 2 sct. sct is an aggregate object containing an array of 2 int.
Each braced list of 4 ints on line 13 initializes one str (although those braces could be omitted too.) Aggregate initialization causes each sub-object to be initialized recursively in the order of appearance (follow the link.)
As my debugger displays, the layout of t (the one declared in the main function) is: