C / C ++ pointer in (Note) - an array of pointers and

13, the array name

int a[10];

// array name is the first element of the array address

// array name is a constant, can not be modified

 

14, pointing to the first element of the array pointer

printf("%d,",*(a+i))

 

15, accessed through a pointer subtraction array elements

// only addition and subtraction

 

16, array of pointers

Pointer array, which is an array, each element pointer

Su set of pointer is pointer to the array

 

17, the value transfer

Modify function does not affect the argument

No matter what type of variable, the variable itself is passed as long as the value is passed

 

18, address transfer

Address variable transmission, if you want to change by the function argument must address transfer

 

19, the array parameter

1 // array parameter is not an array, a pointer variable ordinary

2 // parameter array: int a [100000], int a [], int * a to the compiler, there is no difference

// 3 compilers process as int *

// array of non-difference parameter array of parameter 4: the parameter is a pointer variable array, the array is non-parameter array

int i= 0;

// 64-bit system, sizeof (a), a pointer is a variable, the result is 8

// sizeof (a [0]) element 0, is of type int result 4

20, returns the address of a local variable

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/Robertzewen/p/10469844.html