I can see multiple issues with your code.
First, you are calling the function prompt()
inside the function causing it to recursively call it self over and over until you have a stackoverflow.
Second, your storing your input inside of a bool. You probably meant to use std::string
Third, inside of your if statement you are not checking if the value is equal but setting it when you use the =
operator. If you want to check if the two values are equal use the ==
sign.
Fourth, your use of the if
statement is wrong. If you are checking a value for multiple conditions you should place them all inside if else
all following each other. What you are doing is spearting them into multiple if statements each following an else condition that prints Unknown Command.
]
Seeing as how this looks homework, I won't give you the full code to give you a chance to learn. But if you fix the points above then you will be on your way to having a functional program.