I have a program working quite well. I decided I wanted to declare one of the arrays I was using inside the only function it was being used in as it was not necessary to be global. It is declared as
What I found quite surprised me. I'm not sure why it happens, but when I declare the exact same variable inside the function the program stops working properly (not sure exactly what goes wrong, the numbers it outputs are totally off). If I print the value of either [0] or [1] the value is the same as if the array is declared outside the function. If I set it to [2] while still in the function the program operates properly again.
It's not essential I solve this issue, but I'd like to understand why its happening.
Code:
float beta[1];
It's not essential I solve this issue, but I'd like to understand why its happening.