Generation

generate functionThu, 26 Jan 2023

how to convert the last 2 chars in a string to an int

int convert(str) { return atoi(str.substr(str.length() - 2).c_str()); }

Questions about programming?Chat with your personal AI assistant