First of all, prototype and function must mach.
void polar_to_rect(double&, double&, double , double );
void polar_to_rec(double _mag, double angle, double &x, double &y)
x
and
y
in the function are pointers to
x
and
y
in
main
Make sure that the compiler knows what is going on in the function and store the calculus in the right place.
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.
The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdb.html[
^]
https://www.jetbrains.com/idea/help/debugging-your-first-java-application.html[
^]