struct STRUCTURE
{
int var[10];
STRUCTURE()
{
// how to define here?
}
};
I tried using a FOR loop to do it, but i didn''t seem to work. What else can I do? Thanks!
*====================*
http://www.syntasoft.com
*=======================*
Defining Arrays in Constructors?
How can I define an array inside a constructor?
Say i have:
The for-loop is the only thing that would make sense (for different values). If you all want identical values, such as 0, you might use memset.
Hmm... for some reason when I use the FOR loop it doesn't work. I have no idea why. I haven't tried memset yet though. I do something like this:
[edited by - Gf11speed on February 1, 2003 3:22:58 AM]
typedef struct STRUCTURE
{
int iLookForPass[MAX_PLAY_ADJUSTMENTS];
STRUCTURE()
{
for(int a=0; a iLookForPass[ a ] = UNDEFINED;
}
}
};
[edited by - Gf11speed on February 1, 2003 3:22:58 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement