Error: expression must be a modifiable lvalue

I'm quite inexperienced with C++, and hoping that someone who is more experienced can help me.
I'm trying to make a basic command-line program that converts temperatures, and this error has come up recently:
1
2
3
4
5
6
7
8
9
int tempConverter(char input) {
	if (input = "c" || input = "C") {
		int cLc;
		cout << "Celsius to Farenheit selected. Please enter your value." << endl;
		cin >> cLc;
		double output;
		output = 9/5*(cLc + 32);
	}
}

Microsoft Visual C++ 2010 red underlines the "c" in input = "c" and gives me the popup "Error: expression must be a modifiable lvalue". What does this mean? How do I make this correct?
You should modify second line as if (input == 'c' || input == 'C') {

== stands for comparison (= is an assignment operator).
"" delimit c-string, '' - char.
Thanks.
I'm used to Java and JavaScript, where there is no difference between "" and ''.
Also not quite sure why I thought I should use =. == is (comparison) equal to and at least in JavaScript === is exactly equal to (value and type).
Last edited on
Topic archived. No new replies allowed.