R
RB
Hello I am trying to figure how to initialize structures within an array of structures.
How do you do this ? Below is my pertinent code and futile attempts
// -----in the class header file
protected:
// data holder structures
struct Inlet
{ double dInvert_In_1;
double dInvert_Out_1;
unsigned int uiInletNum;
};
Inlet InletArray [200];
public:
// user input variables
double m_Invert_In_1;
double m_Invert_Out_1;
UINT m_InletNum;
//------------------------------
//------in the class cpp file
// in a class function
Inlet MyInlet = { m_Invert_In_1, m_Invert_Out_1, m_InletNum}; //<-this compiles ok but does not get it into the array
Inlet InletArray[m_InletNum] = { m_Invert_In_1, m_Invert_Out_1, m_InletNum}; //<- flags an error.
How do you do this ? Below is my pertinent code and futile attempts
// -----in the class header file
protected:
// data holder structures
struct Inlet
{ double dInvert_In_1;
double dInvert_Out_1;
unsigned int uiInletNum;
};
Inlet InletArray [200];
public:
// user input variables
double m_Invert_In_1;
double m_Invert_Out_1;
UINT m_InletNum;
//------------------------------
//------in the class cpp file
// in a class function
Inlet MyInlet = { m_Invert_In_1, m_Invert_Out_1, m_InletNum}; //<-this compiles ok but does not get it into the array
Inlet InletArray[m_InletNum] = { m_Invert_In_1, m_Invert_Out_1, m_InletNum}; //<- flags an error.