by cplusplusquestion@[EMAIL PROTECTED]
Apr 14, 2008 at 02:22 AM
>
> for(int i=0; i<MAX; i++)
> a[i] = i;
> int* b = return_a_value();
>
> we can now say that *b will be 0.
const int MAX=20;
int a[MAX];
int* return_a_value(){
return a;
}
int main(){
for(int i=0; i<MAX; i++)
a[i] = 2;
int* b = return_a_value();
for(int i=0; i<MAX; i++)
cout << b[i] << " "; // DOES this right?
return 0;
}