(1) to use an array to obtain the static storage space in a row, use the pointer access to continuous variables in the storage space;
(2) using malloc or new dynamic application continuous space, use subscript access to continuous variables in the storage space,
CodePudding user response:
Basic problem, write yourselfThe wrong post code to ask
The first question
Float fArray [10].
Float * p=fArray;
Loop into the array to
Cycle again with a subscript fArray [I] output, or a * (p + I) output
The second problem
Float * fP=(float *) malloc (10 * sizeof (float).//fp=new float [10] can also
The rest is pointer manipulation bai
Read a book!