c++ - Why wont my "intellect" variable add by 5? -


if (checkforroll == "intellect" && checkforroll == "intellect") {//checks intellect         intellect = intellect + 5;     } else if (checkforroll == "strength" && checkforroll == "strength") {         strength = strength + 5;     }     cout << intellect; 

when execute this, intellect int not add 5. why?

you requiring string equal both intellect , intellect impossible. change "and" (&&) "or" (||).


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -