afaik = as far as I know. You can find most of these by googling "acronym afaik".
I agree with manasij7479 that using a pointer here is generally more awkward than using the index, but there are times when a pointer is easier or tidier. So if you need an example of how to walk a matrix that way:
Code:
#include <iostream>
using namespace std;
int main(void) {
int ray[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9} },
(*p1)[3] = ray, *p2 = p1[0];
while (p1 - ray < 3) {
if (p2 - *p1 == 3) {
cout << endl;
p1++;
p2 = p1[0];
} else {
cout << *p2 << ' ';
p2++;
}
}
return 0;
}
It is very important when doing this that the pointers are correctly typed!
Some things to notice: p1 is effectively the same type as "ray" (technically, ray is an array while p1 is just a pointer, but ray implicitly converts to a pointer in context). However, p2 is not the same type as p1, and so when doing arithmetic with addresses, you must dereference (via *) p1 to make them equivalent, as on line 10 (just as you must dereference p2 on line 15 to get a value).