I wish to achieve to limit user on only 0 or 1 when program asking for boolean variable. I\'we tried to do so, but it doesn\'t work. It still keep asking me for typing in.>
You cant do that :
if (cin && ele == 0 && ele == 1) break;
because its always false because ele cant be in same time 1 or 0 ... It can be only one of this figures.
if(ele == 0 || ele == 1) break;