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
Post a Comment