I am trying to clean up my code a bit and utter chaos has overtaken me. I am seriously confused.
I have an array of 100 structures of 'subsectionData'
which includes a union of 'sectionSpecificData'
which includes a struct of 'circleData'
which includes an array of type double named 'ptX'.
My question is how in the heck do I assign values to this correctly? I tried several things along these lines and this yielded the fewest number of errors but it looks quite tedious to me,
subsectionData.sectionSpecificData.circleData.ptX[0] = subsectionData.XBAR;
and it also gave me these two errors:
inertia.cpp(353) : error C2274: 'function-style cast' : illegal as right side of '.' operator
inertia.cpp(353) : error C2228: left of '.ptX' must have class/struct/union type
Am I even close to getting this correct?
Code:struct sectCircle { double ptX[2]; //...other members here. } circleData; union crossSectionData { struct circleData; //...other members here. }sectionSpecificData; struct subsection { crossSectionData sectionSpecificData; //...all kinds of other members here. } subsectionData[100];