Using pointers, give you array int a[] = {4,34,32,13,15,66};(A + 1), Output *a + 1,* (ptr1-1), *PTR2), and give the solution process.
#include <stdio.h>
int main (int argc, char const *argv[])
{
int a[] = {4,34,32,13,15,66};
int *PTR1 = (int *) (&a + 1);
/*
(&a+1) represents the address of the next block of memory for the storage array a[] memory address, * (&A+1) represents the value of the address after the a[] array, and PTR1 represents the address of this value.
The back output (PTR1-1) is returned to the memory address of the array a[] itself, and is the last small memory address inside, * (PTR1-1) is to take out this value
*/
int *PTR2 = (int *) &a + 1;
printf ("%d%d%d%d\n", * (A + 1), *a + 1,* (ptr1-1), *PTR2);
/*
(a+1) is the address of a[0] stored inside the array a[], to the address of the a[1], still in a[] this large space, quite an array of subscripts from 0+1. * (a+1) is the value in the corresponding address
*a + 1 is to first take out the value stored in address A, then this value +1,
*/
return 0;
/ * Result of this function output:
Imacdeimac-18:desktop imac$ cc zhizhenzuoye.c
Imacdeimac-18:desktop imac$./a.out
34 5 66 34
*/
}
For learning iOS, attack ... C Language Pointer Practice