First, the previous two-dimensional array:
int a[3][4]={1,2,3,4,5,6,7,8,9,1,2,3};
How to operate a pointer for a two-dimensional array like this:
the first concept is that a two-dimensional array has rows and columns.
- the first point is that the * operator accesses the column, and the second point is that the [] subscript operator also accesses the column.
For example, a, * a, a [2], * (a + 2)
A: A is the address of the first row, while * a is the address of the first row and zero column, which is the address of the first row and zero column.
A [2]: the subscript accesses the column of the row, that is, the address of two rows and 0 column.
* (a + 2): a + 2 accesses the address at the beginning of the second line, and a * sign accesses the address at column 0 of the second line.
Pointer to one-dimensional array: int (* P) [4];
when this pointer P points to a two-dimensional array, every P + 1 skips four elements and points directly to the next line.
Read More:
- tf.layers.conv1d Function analysis (one dimensional convolution)
- Array of PHP_ diff,array_ intersect,array_ merge, in_ Is there a limit on the number of arrays in array?
- How to use C + + function pointer array
- Solution to null pointer error in array
- [solved] error: valueerror: expected 2D array, got scalar array instead
- ValueError: need at least one array to concatenate
- In pandas, dataframe and np.array The mutual transformation between the two
- VTK cultivation 26: basic operation of image_ Three dimensional image slice extraction
- Variable type error: error of array occurs when TP5 controller receives the array of post
- Leetcode solution 189 Rotate Array Java version
- JavaScript removes the number specified in the array
- [Python] numpy library array splicing np.concatenate Detailed explanation and examples of official documents
- Quickly convert map to ordered array
- Solve the problem of postgre error #22p02 malformed array literal
- python MemoryError: Unable to allocate 165. MiB for an array with shape
- Remove array duplicate elements
- Implement Set using Array.
- Dataframe and np.array The mutual transformation of
- Array initializer is not allowed here
- How to Fix TypeError: Cannot cast array data from dtype(‘float64‘) to dtype(‘<U32‘)….