Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Freshman c language topic 24, if there is a definition statement: int a[2][3], * p [3]; , followed by the following
Freshman c language topic 24, if there is a definition statement: int a[2][3], * p [3]; , followed by the following
The core lies in the type of p.

Define equivalent to

int * p[3];

Here p is an array containing three elements, each of which is of type int *

therefore

P is an array name and cannot be assigned.

B p[0] is int*, a is the name of two-dimensional array, which is equivalent to int **, and the types do not match.

C a[ 1][2] is an element of A, and its type is int, so&; A[ 1][2] is int* and is the same type as p[0], so this assignment is legal.

D has nothing to say, the error is even more outrageous than B, int***, assigned to int*, and the type does not match.