Wow am I confused...
1. When dealing with my structure 'subsectionData' how should I implement the 'sectionType'(cross section)?
2. Do I even need to use a union here?
3. Am I even on the right track?
In my windows prog. I plan on eventually writing my subsectionData to a binary file and in this way when I open a saved file the program will be able to recreate the data. Once I get this part operational I plan on adding a graphical representation on the main window..
Basically, it will be a limited cad program used to calculate moments of inertia, but I wanted to put off the cad portion until I get the rest of my program functional.
Hope this makes sense to you Gurus out there...
[code]
struct sectCircle {
double diameter;
} circle;
struct sectRectangle {
double base;
double height;
} rectangle;
union crossSectionData {
struct circle;
struct rectangle;// many cross sections omitted for clarity
} sectionType;
struct subsection {
crossSectionData sectionType; // circle, rectangle, triangle, parabola, sector, segment, ect...
double area;
double XCoord;
double YCoord;
double Ixc;
double Iyc;
double Ixo;
double Iyo;
double k;
} subsectionData;
struct composite {
double area ;
double XCoord;
double YCoord;
double Ixc;
double Iyc;
double Ixo;
double Iyo;
double k; // (least I / area)^(1/2)
} compositeData;
[\code]
[edit]
Typo's corrected
[\edit]