This time I try to make a quiz with three questions that should be appearing with order. Somehow, I got an "invalid conversion from 'const char' to 'char" error. I wonder why? This is the code.
const char* is a string(word/sentence)
char is a letter.
And you compare both(and you can't!). Hence, error.
Just change all your conditionals, like in line 14:
if( decision == 'y') // mind the single '
And when I wrote it, I noticed that you made second mistake - you assigned "Y" to decision :) Remember,
= is assignment
== is comparision
If you want to be safe from this kind of mistakes, put constants first, like this
if('Y' == decision)
Now, if you made a mistake and instead of == used =, compiler would tell you that you are trying to assign something to constant. Otherwise, if you do assignment in if, you can have a bug that is hard to find.
This is exactly what i'm doing and thanks to a forum member, i've added more functionality using loops.
You don't have any else if for when the user inputs 'N'.
Have you learnt string, stringstream and getline ?