Home > Back-end >  Entitled what choose a 8 d why not
Entitled what choose a 8 d why not

Time:12-03

CodePudding user response:

Are you sure is to choose A rather than D

CodePudding user response:

D is wrong, because a is 2 d

CodePudding user response:

Choose A right, pay attention to pointer types, p is type int * and A is the int (*) [3] type (array pointer), * (A + 1)==* (& amp; A [1]) is an int * type (see * a what type)

CodePudding user response:

reference qybao reply: 3/f
to choose A right, pay attention to the pointer type, p is type int * and A is the int (*) [3] type array (pointer), * (A + 1)==* (& amp; A [1]) is an int * type (see * a what type)

* (a + 1) refers to what don't understand

CodePudding user response:

Easy to understand, a two-dimensional array is quite and there * *, and so have to use a double pointer to point to it, such as * * p, and whether it's an array or pointer adding * is equivalent to decode, two-dimensional array with a *, is equivalent to a heavy, equivalent to one dimensional array, can use the pointer pointing to it, p if the array before two *, is just like * p, at the same level in content, D option 2 D array can use double pointer char * * p to point to it,

CodePudding user response:

M0_46609566
reference 4 floor response:
Quote: refer to the third floor qybao response:
to choose A right, pay attention to the pointer type, p is type int * and A is the int (*) [3] type array (pointer), * (A + 1)==* (& amp; A [1]) is an int * type (see * a what type)

* (a + 1) refers to what ah don't know much about

(a + 1) from a layer of pointer address plus one, if the array is
A0 a1 a2
B1, b2 b3
Address to b1, an array of the secondary address is the address of the first data is a layer of each row, the array name is the address of the first line in the first column
So a + 1 is the first address line of the address, * into level 1 or level 2 at this time, take a pointer is assigned to p
Pointer d option is the main p level, and is a secondary address

CodePudding user response:


Two-dimensional equivalent of pointer array pointer, and p is a pointer, so D is not correct

CodePudding user response:

* (a + 1) - & gt; A [1] - & gt; A [1] [0] address
D is wrong, because a is two-dimensional (level 2) address, and p is one dimensional (1) a pointer, they don't fit

CodePudding user response:

reference qybao reply: 3/f
to choose A right, pay attention to the pointer type, p is type int * and A is the int (*) [3] type array (pointer), * (A + 1)==* (& amp; A [1]) is an int * type (see * a what type)
note is of type int a [2] [3]

CodePudding user response:

A is a pointer to a two dimensional array, p is a pointer to an int type, type is different, so D is wrong,
  • Related