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.
Printable View
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)
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.