I have the following lines of code: (where a is int64_t* and i is a simple int counter)
uintptr_t p = *a + (i * 4);
int64_t value = *reinterpret_cast<int64_t *>(p); //***
I have followed the following stack overflow post to get this syntax: C++ - Get value of a particular memory address
The problem is I keep getting a segmentation fault on the indicated line. I think this may have something to do with pointer arithmetic but I am not completely sure. Does anyone know why I could be getting a seg fault here?