Define a structure student students, including the student's student id, name, gender and date of birth, date of birth, including (date) (month) (year) program, the output of a student all information,
CodePudding user response:
# include using namespace std; The class Student { Public: Int id; string name; String sex; String birthday; Student (int, string n, string s, string bir) { Id=I; Name=n; Sex=s; Birthday=bir; } Void the show () { Cout & lt; <"Id:" & lt; Cout & lt; <"Name:" & lt; Cout & lt; <"Sex:" & lt; Cout & lt; <"Birthday:" & lt; } }; Int main () { Student s (001, "Michael", "man", "19 XX, XX, XX"); S.s how (); return 0; }
Id: 1 Name: Michael Sex: man 19 XX, XX, XX birthday:
Process finished with exit code 0
CodePudding user response:
Structure, structure, structure Is a struct not class The above code, put the class into a struct and other still