Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Student(char *_last_name = "Smith", char *_first_name = "John",
- char *_patronymic = "", short int _birth_day = 17,
- short int _birth_month = 4, int _birth_year = 1997,
- char *_address = "Moscow", char *_phone_num = "1231212",
- char *_faculty = "IU", short int _year_of_study = 2) :
- birth_day(_birth_day),
- birth_month(_birth_month), birth_year(_birth_year),
- year_of_study(_year_of_study) {
- last_name = (char*)calloc(strlen(_last_name) + 1, sizeof(char));
- first_name = (char*)calloc(strlen(_first_name) + 1, sizeof(char));
- patronymic = (char*)calloc(strlen(_patronymic) + 1, sizeof(char));
- address = (char*)calloc(strlen(_address) + 1, sizeof(char));
- phone_num = (char*)calloc(strlen(_phone_num) + 1, sizeof(char));
- faculty = (char*)calloc(strlen(_faculty) + 1, sizeof(char));
- strcpy(last_name, _last_name);
- strcpy(first_name, _first_name);
- strcpy(patronymic, _patronymic);
- strcpy(address, _address);
- strcpy(phone_num, _phone_num);
- strcpy(faculty, _faculty);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement