I can't seem to remember everything I should about constructors. I'm looking for a way to create an array of structs, using a constructor. My code should explain what I would like to do, and my question.
struct myStruct
{
private:
int structInt1, structInt2;
public:
myStruct::myStruct(int int1, int int2)
{
structInt1 = int1 * int2;
structInt2 = int1 / int2;
};
};
int main()
{
myStruct myStructArray[10] =
{
// Any way to initialize these ten items using the existing constructor?
//Maybe an additional constructor?
}
}