Feb 5, 2011 at 1:54am UTC
o ok ya i totally didnt catch that. i think that might the fix its not supposed to be an array just a string to compare it against
Feb 5, 2011 at 2:21am UTC
ok so i changed it to just a string and i got this error
no match for 'operator-' in 'str_Temp[i] - 32'
line 29 in the code is the formula for changing str_Temp from celsius to ahrenheit
Feb 5, 2011 at 3:27am UTC
so is there a way to get the last 4 places of the string temperature into a float?
Feb 5, 2011 at 7:16am UTC
if the temp is in Fahrenheit it needs to be converted to celsius. I dont know how to test if its and F or a C and then change the data accordingly
Feb 5, 2011 at 9:48pm UTC
1 2 3 4 5 6 7 8
double value;
char suffix;
cin >> value >> suffix; //input 3.14F or 3.14 F
switch ( suffix ){
case 'F' : case 'f' : cout <<value<< " Fahrenheit" <<endl; break ;
case 'C' : case 'c' : cout <<value<< " Celsius" <<endl; break ;
default : cout << "Invalid input" <<endl;
}
Last edited on Feb 5, 2011 at 9:48pm UTC
Feb 6, 2011 at 2:31am UTC
Well i figured it out, finally. the switch statements helped alot. I appreciate all the help ne555 thank you very much.