#include <iostream>
struct entity {
int x, y;
};
int main() {
entity e = { 5, 8 };
int* pos = (int*)&e;
std::cout << pos[0] << ", " << pos[1] << std::endl;
}
so if i look at this code, &e get the memory address, when u cast it with an int pointer, its basically telling its an int and the pointer is telling the location of that e object memory address, and then store those memory to the int* pos? so basically ur just changing the memory location to a different memory?