X hits on this document

130 views

0 shares

0 downloads

0 comments

23 / 63

Copyright ©2004 Pearson Addison-Wesley. All rights reserved.

8-23

Passing array as function parameter

Array names are pointers.

The name of an array contain the address of its initial element, a = &a[0];

Passing an array as function argument copies the value of the pointer to the formal array parameter and points to the same location.

Where is the array actually located?

At the data area of the function that declared it.

For an array declared as formal parameter, space is allocated in the function data area only for the address of the initial array element of the array passed as actual argument.

Document info
Document views130
Page views130
Page last viewedSat Dec 03 11:39:49 UTC 2016
Pages63
Paragraphs754
Words4119

Comments