Can anyone help me with this ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
28th Jan 2020, 6:51 AM
حيدر الشامي
حيدر الشامي - avatar
4 Answers
+ 5
You initialize gender wrong. It's a String value not a number. so here You can initialize gender as char[] gender; No need to initialize this if you are comparing string values int male,female;//no need to initialize Check here to compare String in c++ https://www.geeksforgeeks.org/stdstringcompare-in-c/amp/
28th Jan 2020, 6:55 AM
A͢J
A͢J - avatar
+ 4
Or you can do something like this. https://code.sololearn.com/cXL1giC1m2U1/?ref=app
28th Jan 2020, 6:56 AM
Avinesh
Avinesh - avatar
+ 3
the male or female need to be a string not an int
28th Jan 2020, 6:54 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
My thanks
28th Jan 2020, 7:02 AM
حيدر الشامي
حيدر الشامي - avatar