VasiPeycheva / Data-Structures-and-Algorithms--2018-2019

Lections and code from Data Structures and Algorithms course 2018-2019: VIP edition (the course is held by Vasilena, Ivan, Plamen)
9 stars 1 forks source link

stoi() instead of atoi(<cast to cstring>) #3

Closed hribo98 closed 5 years ago

hribo98 commented 5 years ago

You can use stoi() to directly cast to int. In Student.h line : 32 data.age = atoi(age.c_str()); --> data.age = stoi(age);

http://www.cplusplus.com/reference/string/stoi/

Also stol (long), stoll(long long)...

Поздрави, Ицо

VasiPeycheva commented 5 years ago

Thank you for your advice! I will correct it!