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;
¿Fue útil?

Solución

módulo :

int lastDigit = time % 10;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top