Jun 17, 2011 at 1:02am UTC
what do int and double mean exactly.
Jun 17, 2011 at 1:04am UTC
int = integer.
Eg. int x = 3 (means x is an integer and x is assigned an integer value of 3)
double = decimal
Eg. double x = 3.111 (means x is a decimal value and x is assgined a value of 3.111)
Jun 17, 2011 at 1:10am UTC
So what is float?
And how come in an example I see things such as
cout << "enter a fahrenheit: "
double fahrenheit;
cin >> fahrenheit;
is the double there assuming the user will input a decimal number?
Thanks so much!
Jun 17, 2011 at 1:12am UTC
Float is like double, it uses decimals, except it is smaller in the number that it can take. Also, yes in your example, it is set to double Fahrenheit because the user may put in something like "98.8" degrees fahrenheit.
Jun 17, 2011 at 1:16am UTC
great, also a question about the pow function.
If I am using A^b power in an equation do i do pow(a,b) or pow(b,a)?