For demonstrational purposes, let's say we have the following struct:
struct Happy
{
int X;
int Y;
int Z;
RECT AppleSauce;
}
Now let's say we define a PowerKeg as follows:
struct PowerKeg
{
Happy DeathlyIll;
int count;
}
// and then:
PowerKeg Zippy(100) // <- This is an array, but I can't user brackets because it thinks it's html coding...
Now that we have the formality out of the way, here is the real meat of the question. Let's say that I have some nice while loop...no, let's make that a for loop. So as we are transversing the loop as they say, we are doing something as follows:
for(int i = 0; i < 100 ; i++)
{
Zippy .DeathlyIll.AppleSource.left = 0;
Zippy .DeathlyIll.AppleSource.right = 1;
Zippy .DeathlyIll.AppleSource.top = 2;
Zippy .DeathlyIll.AppleSource.bottom = 3;
};
This would of course be pointless to do, but it seems to me that it would (should?) be possible to make this a little pretty (and assumedly faster) by doing something like the following:
RECT *SuperTemp = NULL;
for(int i = 0; i < 100 ; i++)
{
SuperTemp = &Zippy(i).DeathlyIll.AppleSource;
*SuperTemp.left = 0;
*SuperTemp.right = 1;
*SuperTemp.top = 2;
*SuperTemp.bottom = 3;
}
Well, something like that... Anyway, any answers or comments would be...well, most helpful
...
Thanks,
-> Briar LoDeran <-
Edited by - BriarLoDeran on 6/14/00 11:33:09 PM