an array name without brakets (ie: "degTheta" instead of "degTheta[i]") returns a pointer to the array. That's why you're getting a funky address printed.
Besides that, you are making an array that has a variable as the number of elements:
double degTheta[ arraySize ];
This is bad.It is not allowed in C++, in C it is, but C doesn't have vectors, so they needed something similar too.Unfortunately, the compiler will allow this.It won't give a error.But even if it works sometimes, othertimes you will get an error.Do not use this way of declaring an array.You should specifically put the number of elements that the array has, like:
double degTheta[10]; // the array has 10 elements
If you want array of variable length, use vectors.
Besides that, you are making an array that has a variable as the number of elements:
double degTheta[ arraySize ];
This is bad.It is not allowed in C++, in C it is, but C doesn't have vectors, so they needed something similar too.
It's BAD... WHY???? I always thought that it is a good practice to use a constant variable as the array size. If he would not have used a constant variable, then it would have been bad.
But even if it works sometimes, othertimes you will get an error.
This will work everytime. I don't see a reason as why it will not work. Could you please give an example of a scenario when it is declared as a local variable and not working?