February 2005
Beginner to intermediate
272 pages
4h 53m
English
Array formal arguments are problematic. The major surprise in store for the C/C++ novice is that there are no array formal arguments, because an array is passed as a pointer to its first element.

This automatic transformation from array to pointer is given the charming technical term “decay”; an array decays to a pointer to its first element. The same thing happens to functions, by the way. A function argument decays to a pointer to a function, but, unlike an array that loses its bound, a decaying function has the good sense to hold onto its argument and return types. (Note also the proper compile-time calculation ...
Read now
Unlock full access