Pre{line-height:1;color: #3c3c3c; Background-color: #d2c39b; font-size:16px;}. Sysfunc{color: #627cf6; font-style:italic;font-weight:bold;}. Selffuc{color: #800080;}. Bool{color: #d2576f;}. Condition{color: #000080; font-weight:bold;}. Key{color: #000080;}. Var{color: #800000; font-style:italic;}. Digit{color: #ff00ff; font-weight:bold;}. Includepre{color: #3c3c3c;}. operator? {color: #008000; font-weight:bold;}
?? (i) define an integer?????????????
Int?*
P?
=
New?
Int;????????
Int?*
P?
=
New?
Int
(
4
);? Assigning an initial value
4?? (ii) Define a one-dimensional array?????????????????
Int?*
P?
=
New?
int[
SIZE];?????????
p? points to the first address of the array, which is the
base unit of type int, and
p is used as the array name?? (iii) Define a two-dimensional array??????
int
(*
p
) [
column]=
New?
int? [
size][
Column]????????????
First define a pointer (*p) [Column], which indicates that the pointer is in size? column int type? The space is the basic unit, and the new?int[size behind] ... To open up a size space
?
? The first pointer represents a pointer unit in the first two cases???????????? The second pointer represents the pointer element in the case of a two-dimensional array, so that when a two-dimensional array, the pointer is
Column? A
IntThe size of the space is a basic unit of the???????????????
P[
0][
0]? indicates that the first
0Such a basic unit.
0The value of an element??????????
P[
1][
0]? indicates that the first
1Such a basic unit.
0The value of an element????????? Therefore, declaring a two-dimensional array pointer?????????????????
Int?
(*
P
) [
column];//?
p points to the [
column] structure, and the [
column] structure is the
???????? of the base unit of type int Similarly, three-dimensional arrays can be defined as follows:???????????????
int?
(*
p
) [column_1][column_2]=
new?
int? [
size][column_1][column_2]
?
This article uses the software of calligraphy and painting fiction, content and software independent, calligraphy and painting fiction software? More enjoyable to read, more enjoyable to write, easier to publish.
New? Dynamically allocate array space?. XML