I'm just now learning C++, and this simple program is driving me nuts! It's a program that prompts the user to enter the radius of a circle and outputs the area and circumference. I thought I did everything correctly, but I get this error message:
"Run-Time Check Failure #3 - The variable 'radius' is being used without being initialized."
Like Peter87 said, you're trying to use a variable in your area calculation before you establish what radius you're using. When you say "double radius;" you're allocating a space in memory for a double named "radius", but it doesn't have a value yet, just random garbage values. Now go down to line 11 in the area calculation, you're multiplying PI (which you set to 3.14 earlier) by radius, only problem is, you never gave radius a value!
Make sure the user enters a value before you use variable. A good general rule is to always initialize variables to something (like 0) before using them because using uninitialized variables can lead to some big problems. So set them equal to some base value, then have change the value by having the user input the new value. By doing this, if something goes wrong, your variables automatically default to a valid value before using them.