+ 1
*(ptr + i)
int a[5] = {22, 33, 44, 55, 66}; int *ptr = NULL; int i; ptr = a; for (i = 0; i < 5; i++) { printf("%d ", *(ptr + i)); // why it writes like *(ptr + i) while i is an integer?
2 Respostas
+ 6
This might help as an intro to pointer arithmetic 👇
https://codeforwin.org/2017/10/c-pointer-arithmetic.html