My theoretical understanding of C/C++ Pointers

Basically, imagine this: x = y = z. if you change one of the variables, they all change. That’s how C/C++ pointers work. Take this

int x, *y;
x = 20;
*y = x;
y = 20;
// x and y are now equal to 20

That should work and make sense, but if that doesnt compile, apply common sense

Leave a Reply