Re: vector and for-loop

From: Duane (spoo_at_zowie_flarn.com)
Date: 12/06/04


Date: Mon, 6 Dec 2004 11:56:27 -0500


"Andrew Koenig" <ark@acm.org> wrote in message
news:iv%sd.1041901$Gx4.546715@bgtnsc04-news.ops.worldnet.att.net...

> The first question is why you want to initialize a bunch of vector elements
> in the first place.
>
> Why aren't you waiting until you actually need the elements and creating
> them then? That way, you don't have to construct elements that you don't
> need.

It looks like he wants to set a member of the object held in the vector
to 0, not the vector element itself. Who knows, maybe this is some
sort of counter etc. Having the object set the member to 0 at initialization
should do that or maybe I'm missing something...