New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Can anyone help me with this ?
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/
+ 4
Or you can do something like this.
https://code.sololearn.com/cXL1giC1m2U1/?ref=app
+ 3
the male or female need to be a string not an int
+ 2
My thanks