Original Post
C++
Is it possible to call a constructor with parameters for a struct within another struct? (Something like this, though VC++ is highlighting the "2" in myA and saying it wants a type specifier, so this is obviously wrong).
[source lang="cpp"]struct A{
int iSize;
A(int x = 10) { iSize = x; }
}; // A
struct B{
A myA(2);
}; // B[/source]
Essentially I want a struct that has a standardized initial Size member, but I also want to be able to specify a different Size member for it when it is itself a member of other structs.
Is it possible to call a constructor with parameters for a struct within another struct? (Something like this, though VC++ is highlighting the "2" in myA and saying it wants a type specifier, so this is obviously wrong).
[source lang="cpp"]struct A{
int iSize;
A(int x = 10) { iSize = x; }
}; // A
struct B{
A myA(2);
}; // B[/source]
Essentially I want a struct that has a standardized initial Size member, but I also want to be able to specify a different Size member for it when it is itself a member of other structs.