Discuss a pointer to array structure with syntax and example
Answers
Answered by
0
Answer:
Pointer to Array
Use a pointer to an array, and then use that pointer to access the array elements. For example, #include<stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; for (int i = 0; i < 3; i++) { printf("%d", *p); p++; } return 0; }
Answered by
1
Explanation:
Pointer to Array
Use a pointer to an array, and then use that pointer to access the array elements. For example, #include<stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; for (int i = 0; i < 3; i++) { printf("%d", *p); p++; } return 0; }
Similar questions