I'm trying to get this function to work where it asked the user to input a value for temp, and then calculates falling distance by using the following formula: d=0.5*g*t^2.
I keep getting a warning "warning C4700: uninitialized local variable 'd' used"
Then an error to abort stating "The variable 'd' is being used without being initialized"
I don't understand this since I have 'd' initialized in both the function and the call, well at least I think I do.
In your main function, you declared d, but you didn't initialize it with a value. You give this uninitialized variable to your calcFallDistance function, which will make the compiler complain.
In your calcFallDistance function, you declared t, but did not initialize it with a value. Then you try to take the square of the uninitialized variable, which will make the compiler complain.
Ok so I fixed everything and get the code to compile and give me the results i want. My next question is, how do I get rid of the global variables? I'm not sure what to do.