Rick C. Hodgin
unread,Oct 21, 2015, 11:31:35 PM10/21/15You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Is there a version of C or C++ extension which takes this:
struct SAbc
{
int a;
int b;
int c;
};
struct SAbc myAbcVar[] =
{
{ 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 }
};
And lets me change my structure to this:
struct SAbc
{
int a;
int b;
int c;
int d;
};
Without having to do this manually:
struct SAbc myAbcVar[] =
{
{ 1, 2, 3, -1 },
{ 4, 5, 6, -1 },
{ 7, 8, 9, -1 }
};
By allowing me instead to do something like this:
struct SAbc
{
int a;
int b;
int c;
int d = -1; // Default all unspecified values to -1
};
?
Does C++ or another C-like language have the ability to either
initialize all members in the struct definition, or to initialize
those members which are added on to the end later, as with C++'s
ability to initialize unspecified parameter values?
Best regards,
Rick C. Hodgin