Hi,
I am creating a program to help me memorize stuff but I need a variable that will hold full sentences with spaces.
Also i want to be able to check weather the user input macthes the correct answer.
Thank You.
Hi,
I am creating a program to help me memorize stuff but I need a variable that will hold full sentences with spaces.
Also i want to be able to check weather the user input macthes the correct answer.
Thank You.
std::string is what you want. You use the == operator to compare them (case-sensitive)
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
Depending on your exact usage, std::vector<std::string> may be more appropriate.
(For example, what if the user enters an exra whitespace somewhere.)
Comparing would then need a loop, though.