"JKop" <NULL@NULL.NULL> wrote in message
news:64xad.33165$Z14.12820@news.indigo.ie...[color=blue]
> Gernot Frisch posted:
>[color=green]
> > Hope you know what I mean...
> >
> >
> > void Work(int& r[4])
> > {
> > r[0]=0;
> > }
> >
> > int main(int, char**)
> > {
> > int a[4]
> > Work(a);
> > }
> >[/color]
>
> Here's some functions that'll alter an array of 4 elements:
>
> void Monkey(int* const p_blah) throw()
> {
> p_blah[0] = 67;
> p_blah[1] = -54;
> p_blah[2] = 76;
> p_blah[3] = 47;
> }
>[/color]
I think const is a little misleading here. The function gets a copy of the
pointer anyway so the caller wouldn't care if the function changed its
value. Also, I see you have discovered throw specifications. Unfortunately
they don't do what you might think (for instance prevent the function from
throwing) and I think most experienced programmers avoid them.
[snip]
--
Cy
http://home.rochester.rr.com/cyhome/