0 votes
by (120 points)
Are all arrays pointers in C++?

1 Answer

0 votes
by (1.4k points)
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; }

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 14, 2021 by pointers (160 points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Feb 6, 2020 by joystick (640 points)
0 votes
1 answer
asked May 26, 2021 by arraysize (120 points)
0 votes
1 answer
...