Use atoi() defined in the <cstdlib> header to convert from text to int.