Try putting the const keyword after static in the inputstring variable declaration with ""s still in your if statements:
static const char inputstring = cin.get();
Doing so should make inputstring a constant char, which should match up with the if statement and at least if anything prevent that error.
It didn't work.

I still got that conversion error...
Well, take a look at my current code. I'll break it all down, while I'm posting, so I can get a better understanding of what is actually going on.
#include <iostream>
using namespace std;
int main()
{
static int a = 4 * 6; // (Note use of comments and of semicolon) a is 24
static int b = a + 5; // b equals original value of a with five added to it
cout<<"Please enter letter 'a' or 'b': ";
static char inputstring = cin.get(); // inputstring equals the ibput by the user, which is in this case, 'a' or 'b'
if (inputstring = a) {
cout<<"You entered 'a' which equals: "<< a <<endl;
}
else if (inputstring = b) {
cout<<"You entered 'b' which equals: "<< b <<endl;
}
else {
cout<<"This program only accepts 'a' or 'b' as input"<<endl;
}
}
Ok, so the first line of the
int main() function (not counting the "{" or commented out sections of course) is
static int a = 4 * 6;
This line of course declares "a" as a permanently stored variable, of the "int" (integer) type, and defines the value of the "a" variable as
4 * 6 which of course equals 24.
The next line is
static int b = a + 5;
This of course performs the same type of operation done on the "a" letter, i.e. declaring
b as an integer, and defining its real value (which equals 29).
The next line
cout<<"Please enter letter 'a' or 'b': "; which follows it uses the "cout" keyword to display the output indicated by the "<<" and " "" " operators, and ends the line with a semicolon. The output as one can see by simply looking at the middle of it is "
Please enter letter 'a' or 'b:" without the quotes of course when it is actually being shown in the output of the compiled program.
The next line
static char inputstring = cin.get(); declares 'inputstring' as a variable of "char" type which can store a single character (though to be honest, I'm not sure what they mean by "character"...whether that means the input can only be a single character when using that type of variable, or if it simple means there can only be one value given in the input), and defines the variable 'inputstring' as the function
cin.get() which reads in input by the user, and uses it to perform whatever functions follow.
The next line in the code
if (inputstring = a) uses the "if" keyword to make a simple test. If the condition given in the "if" statement is found to be true, then the code after it is executed. But, if on the other hand, the the condition is found to be false, it goes to the "else" statement, or in this case the "else if" statement as that is before the "else" statement. Ok, so what (inputstring = a) does is basically make the statement that the variable 'inputstring' (which was already defined as being equals to the
cin.get() function, which reads in input by the user) equals the variable 'a' which in turn was pre-defined as having the value of 24.
So, what its saying is cin.get () = 24. Now, what determines whether that is true or not (in *theory* at least) is what follows the "if" statement.
So the next line in the program is
cout<<"You entered 'a' which equals: "<< a <<endl;
Now, what that line does is tells the program to give off the output of "You entered 'a' which equals: " when the variable equaling 24 (namely
a) is given in the user's input. So, what should happen is when the "if" statement is found to be true (i.e. when 'a' is entered), it returns
a's ouput, already mentioned. But, if on the other hand the statement is found to be false (such as in the case that the user enters a variable that amounts to 29, a, instead of 24, b) the program skips the code under the "if" statement and goes to "else if" instead.
So the following line is of course
else if (inputstring = b)
Now, "else if", from what I understand, is an alternative to an "else" statement, which in turn is given in case the "if" statement is found to be *false*, the program can continue and not halt. Also, from what I've read, its possible to have multiple "else if" statements, but not multiple "else" statements. And, it also seems that the better way to go when using "else if" statement and "else" statements together, is to have the "else" statement following the "else if" statement(s). (If I have that wrong, then please correct me...

)
Ok, so what line does is it gives another statement, basically stating that the
cin.get() function equals the 'b' variable, or the value of 29. Now, of course in order for that statement to be true, it needs to be matched with the value of 'b' in the input given by the user...other wise the program moves on to the "else" statement. And if found to be true, it of course executes the code contained within the braces of that statement:
Code:
cout<<"You entered 'b' which equals: "<< b <<endl;
Now what should happen is when the value of 'b' is given in the user's input, the program returns the output "You entered 'b' which equals: 29".
and ignores both the "else if" and the "else" statements, as the "if" statement was found to be true.
Of course, if the "else if" statement was in turn found to be *false*, then the program moves on to the "else" statement, and executes that code instead. So the lines that get read next are:
Code:
else {
cout<<"This program only accepts 'a' or 'b' as input"<<endl;
}
which tells the program (in theory) that if the input by the user does not match either the value of 'a' or 'b', it'll return a message saying "This program only accepts 'a' or 'b' as input".
So in the case of the "else if" statement being *true* (as in the input by the user matches the statement of "else if" by the 'b' variable being given by the user) then the "else" statement would be ignored, and the program would just read from the "else if" statement of course, and execute the code contained within the braces of that statement.
Now, all of that is well and good, except...I can't figure out why its not working then! :wtf: Everything I have just shown indicates that the code is correct, and should do exactly as I expect it to (i.e. display the correct output for either declared variable entered), but for some reason, its not doing it...
Jake
Addendum:
All of this over what *should* have been just a simple program to write...:glare: