Home > Back-end >  How according to the user's input to the output structure of a certain value?
How according to the user's input to the output structure of a certain value?

Time:01-09

For example, I typedef struct
{int the age;
String sex;
} student;

Then the student a; A.a ge=14;
A.s ex="boy".
Then the string s
User input is stored in the s to
Such as user input sex
Then I direct output a.s
But they cannot output the ideas how to modify?

CodePudding user response:

 if (0==stricmp (s.c _str (), "sex")) {... } 

CodePudding user response:

The standard library: a map

CodePudding user response:

In 2022, a freshman small white can I ask you a detailed answer, practice to use, the ball ball all the
  • Related