Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Since array references decay into pointers ...
Since array references decay into pointers, if arr is an array, what's the difference between arr and &arr?
✍: Guest
The type.
In Standard C, &arr yields a pointer, of type pointer-to-array-of-T, to the entire array. (In pre-ANSI C, the & in &arr generally elicited a warning, and was generally ignored.) Under all C compilers, a simple reference (without an explicit &) to an array yields a pointer, of type pointer-to-T, to the array's first element.
For a simple array
int a[10];
a reference to a has type ``pointer to int,'' and &a is ``pointer to array of 10 ints.'' For a two-dimensional array like
int array[NROWS][NCOLUMNS];
a reference to array has type ``pointer to array of NCOLUMNS ints,'' while &array has type ``pointer to array of NROWS arrays of NCOLUMNS ints.''
2015-12-09, 1157👍, 0💬
Popular Posts:
What is more advisable to create a thread, by implementing a Runnable interface or by extending Thre...
How To Merge Values of Two Arrays into a Single Array? - PHP Script Tips - PHP Built-in Functions fo...
How do we create DCOM object in VB6? Using the CreateObject method you can create a DCOM object. You...
What's the difference between J2SDK 1.5 and J2SDK 5.0? There is no difference, Sun Microsystems just...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...