C Language Example - Using Pointers to Access Array Elements
Access array elements using pointers.
Example
#include <stdio.h>
int main()
{
int data[5], i;
printf("Input elements:");
for(i = 0; i < 5; ++i)
scanf("%d", data + i);
printf("You entered:\n");
for(i = 0; i < 5; ++i)
printf("%d\n", *(data + i));
return 0;
}
The output result is:
输入元素: 1 2 3 5 4 你输入的是: 1 2 3 5 4other extensions