Freitag, 11. November 2011

c, ch programming: passing the whole array

c, ch programming: passing the whole array

excerpted from : Computer Science : A Structured programming Approach Using C, ch8, by Forouzan and Gilberg

1. In C, the NAME of an array is a primary expression whose value is the ADDRESS of the FIRST element in the array.

2. Since indexed references are simply calculated addresses, all we need to refer to any of the elements in the array is the ADDRESS of the array.

3. Because the NAME of the array is in fact its ADDRESS, passing the array NAME as opposed to a single element, allows the called function to refer to the array back in the calling function.

唔向左走向右走怪得之JUPAS 個分年年高開


有朋友上左讀 PhD,話八成研究經費都批左比大陸人


11 November 2011 香港電台 - 頭條新聞

C for Engineers and Scientists :An Interpretive Approach. Author: Harry H. Cheng

Keine Kommentare: