Open ydoh2016 opened 3 years ago
void assign (size_type n, const value_type& val) param: replace vector with val repeated n times return: void be careful: it replaces original vector http://www.cplusplus.com/reference/vector/vector/assign/
bool empty(void) const param: void return: true if empty, false if not https://www.cplusplus.com/reference/vector/vector/empty/
reference back(void) / const reference back(void) const param: void return: last element of vector https://www.cplusplus.com/reference/vector/vector/back/
size_type size(void) const param: void return: size of vector be careful: it returns type is size_type, which is unsigned type https://www.cplusplus.com/reference/vector/vector/size/
void push_back(const value_type& val) param: value to push back return: void https://www.cplusplus.com/reference/vector/vector/push_back/
int stoi(const string& str, size_t* idx = 0, int base = 10) param: interpret str from idx on base, set idx(ptr) on next character after all numbers return: interpreted integer https://www.cplusplus.com/reference/string/stoi/
string& append(const char* s, size_t n) param: append s n time return: appended string http://www.cplusplus.com/reference/string/string/append/
Belows are STLs I often use.