+ 1

If statement with boy and girl

So I am making a game, and I want the user to input which gender they are. So something like if boy say something and if girl say sometging different but i cant understand how? https://code.sololearn.com/cjyiWqrnObGQ/?ref=app

31st May 2018, 2:33 PM
Mats Hvatum
Mats Hvatum - avatar
1 Antwort
+ 2
char gender; cout <<"your gender (b/g)"; cin >> gender; if(gender == 'b') { // code for boys } else { //code for gals }
31st May 2018, 2:53 PM
‎ ‏‏‎Anonymous Guy