I'm fairly new to this, but I'm using C++ to simulate a basic planet orbiting around a sun. I'm using a 'leapfrog simulation' to update the position and velocity of the planet as time goes on, the details of which aren't super important. Point is, the code doesn't work, with the problem being that the force vector won't update, even as I call the function which updates it using pass by reference in the for loop in main(). Can anybody spot an issue?
cire's point about the arguments being the wrong way round in the call to pow() is probably what is stopping your code from running.
You don't use it at the moment, but I would fix your expression for kinetic energy: a.K = (1/2*a.m*VelocityMag(a)*VelocityMag(a));
The integer division implicit in the 1/2 bit will mean that the KE is always zero: not very acceptable if you are a physicist. (The expression is also very inefficient, since you square-rooted to find VelocityMag and now you are squaring back again.)
That also looks like an incredibly small timestep dt, given the distances and velocities involved.