by Richard Heathfield <rjh@[EMAIL PROTECTED]
>
Apr 14, 2008 at 09:08 AM
cplusplusquestion@[EMAIL PROTECTED]
said:
> There is an array:
> int a[MAX];
>
> and the function will return a[MAX] value:
>
> int* return_a_value(){
> return a;
> }
>
> Is this code correct?
It isn't clear what you mean by "will return a[MAX] value" but, since
there
is no value available at array element a[MAX], it seems you may want to
return the entire array. The above code will not achieve this. Instead, it
will return &a[0]. That is probably adequate for your needs, however.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www.
+rjh@[EMAIL PROTECTED]
users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999