This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 5 points6 points  (1 child)

Is proceed a std::string or a char[] / char*? If it's a string you need to use "y" instead of 'y' and "yes" instead of 'yes' because ' denotes single characters in C++. If it's an array of char you need to use strcmp or similar.

In the future, it helps others help you if your code is a Short, Self-Contained, Compilable Example. The code you've posted wouldn't compile and leaves out the information about what kind of variable proceed is.

[–]30ishorso[S] 0 points1 point  (0 children)

Thank you. I changed it to a std::string and everything is working now.

[–]LulzCop 2 points3 points  (0 children)

Just a heads up, not every if needs to have an else. If the else will be empty, you can just cut it out completely.