Re: Using pointers

From: jeffc (nobody_at_nowhere.com)
Date: 02/09/04


Date: Mon, 9 Feb 2004 10:12:13 -0500


"Joec" <joec@annuna.com> wrote in message
news:wWAVb.20279$uM2.2620@newsread1.news.pas.earthlink.net...
>
>
> Dan Moos wrote:
>
> > I am also a beginner, but will try and give my thoughts also.
> >
> > Dynamic memory is a good way to go when you don't know ahead of time how
> > many objects your gonna have. Like, say a 3D rendering program, in which
the
> > item being drawn has 10 or 10,000 triangles. It is inefficient to make
an
> > array or other structure that is big enough to hold the largest number
of
> > objects you predict you'll need. It's wastefull to dedicate an array of
> > 10,000 units when you might only need 10.
> >
> I think a vector would be good.

A vector *would* be good. But just keep in mind that someone already
programmed vector for you, and he used pointers to do it.



Relevant Pages

  • Re: Using pointers
    ... I am also a beginner, but will try and give my thoughts also. ... Dynamic memory is a good way to go when you don't know ahead of time how ... It's wastefull to dedicate an array of ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Using pointers
    ... Dan Moos wrote: ... > Dynamic memory is a good way to go when you don't know ahead of time how ... It's wastefull to dedicate an array of ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Real Beginner
    ... I am a real beginner so at the risk of being slammed by some, ... my $lastperson = shift @peoplec; ... Then you shouldn't have to iterate through each item of the array, or 'shift' off items from a duplicated array. ...
    (perl.beginners)
  • Re: Efficiency Question: Large Arrays vs. Indexed Files on Alphas
    ... >decide to read some fields of some records into an array and ... >maintain records that will eventually be written to an output file ... saved the entire file contents in dynamic memory and the SOR$ utility ... routines to sort them, then formatted the records for the output file. ...
    (comp.os.vms)
  • Re: Does Array Declaration Provide Zero Initial Values ??
    ... drop the beginner description. ... printed really big letters on fanfold paper, ... filled up a 120 by 60 array for each letter, and then printed that, ...
    (comp.lang.fortran)