Generation

generate functionThu, 26 Jan 2023

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

int lastTwoToInt(string s) { return (s[s.length()-2] - '0') * 10 + (s[s.length()-1] - '0'); }

Want to kickstart your project?Use the new AI Studio to create your code