C / Objective-C leer y acceder al último dígito del número entero?
-
14-10-2019 - |
Pregunta
¿Cómo puedo conseguir el último dígito de un número entero (o NSInteger) da salida hacia entero?
ejemplo:
int time = CFAbsoluteGetCurrent();
int lastDigit;
Solución
módulo :
int lastDigit = time % 10;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow