What am I doing wrong? it says operand types are incompatible

#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
double temp, result;
char type;

cout << "Please enter a temperature then a space followed by either c for Celsius or f for Fahrenheit: ";
cin >> temp >> type;

if (type == "c" || type =="C")
{
result = (9.0/5.0)*temp + 32.0;
cout << "The temperature is " << result
<< " degrees Fahrenheit." << endl;
}
else if (type == "f" || type == "F")
{
result = (5.0/9.0)*(temp-32.0);
cout << "The temperature is " << result
<< " degrees Celsius." << endl;
}
else
{
cout << "The entry is invalid, please try again.";
return 1;
}
return 0;
}
It also says which lines have that error.


I bet that there is no equality comparison between char and const char *.
'c' is a char
"c" is a c-style string, i.e. const char *
holy moley, thanks! that made the difference. :] sorry im a rookie programmer!
Topic archived. No new replies allowed.