Re: illegel indirecion

From: Ron Samuel Klatchko (moocat94122_at_yahoo.com)
Date: 06/16/04


Date: 16 Jun 2004 14:32:10 -0700

Karl Heinz Buchegger <kbuchegg@gascad.at> wrote in message news:<40D05312.53200D17@gascad.at>...
> JKop wrote:
> >
> > MiKy posted:
> >
> > > I am getting this error:
> > > Illegal indirection at line : a[*count_circle].SetArea(p1);
> > > Is it possible to set an object in an array like I am trying to do ?
> > >
> > > void CreateCircle(Circle* a, int count_circle)
> > > {
> >
> > I can only presume that a points to the start of an array of Circle*.
>
> ... then the first argument to this function would be of type Circle**.
> Since it is not you can deduce that a does not point to the start of an array
> of Circle*

A Circle* can most definitely point to an array of Circles. A Circle**
will actually point to an array of pointers to circles. Since you have
an array of pointers, you can then actually have any object derived from
Circle to enable you to get polymorphic behaviour.

But if all you have are actual circles, an array of actual instances of
Circles would be represented by Circle*.

samuel



Relevant Pages

  • Re: sumif column contains text
    ... The MMULT function is limited to 5461 rows. ... This will return a horizontal array of either TRUE or FALSE ... circle, red circle, yellow circle, blue square, red square and so on.) ...
    (microsoft.public.excel.misc)
  • Re: sumif column contains text
    ... Sorry for the slight mix up about what I ... This will return a horizontal array of either TRUE or FALSE ... circle, red circle, yellow circle, blue square, red square and so on.) ...
    (microsoft.public.excel.misc)
  • Re: sharing information in a class
    ... But there are situations when the first form is better, ... >> does not pick a Circle from an array and display that. ... int count_cylinder = 0; ...
    (comp.lang.cpp)
  • Re: linear to 2D mapping
    ... > filter as in DSP filter design .. ... You have an array of elements, ... each of which you wish to turn into a circle with radius equal to its ... You have your radial mapping! ...
    (sci.math)
  • Re: sharing information in a class
    ... > does not pick a Circle from an array and display that. ... > but that function should not be a member of the Circle class. ... And if you are not passing anything with you void function, ...
    (comp.lang.cpp)