2.) The second thing is: what am I going to do once I finish learning the basics of C++ (and actually advanced things too)? You can do great things with the command prompt (if that's not what it's called, I'm talking about the black window that the programs run on), but that's pretty limited, and its UI is terrible. Would I be able to make a program with at least a semi-decent UI (meaning you can at least click on things), make an OS, or something else? Basically, what could I do with C++ in the future??
float diam (int a)
{
float r;
r=a/3.141592654;
return (r); // notice how it returns a value?
} // this means that most of the time you'll use the assignment operator with this function
...
somevariable = diam (a); // assign the return value of diam (a) to somevariable
cout << somevariable; // output the value of somevariable to the screen
...
// compared to
...
cout << diam (a); // assign the return value of diam (a) to what?
...
// you could also do stuff like this:
...
if (diam (a) > 5) // lets say diam (a) returns 8. the test expression really looks like this to the compiler:
cout << "Value is greater than 5!\n"; // if (8 > 5)
...
Oh wow, I switched up the calling of my functions, so to find the circumference, I was calling the function that multiplied by pi, and it was switched around with the diameter function too.
@ Phil123 and soranz: I do understand what you guys were saying though, thanks.