Question d’entretien chez Indiegogo

Write the base C function atoi(char* string) without using the built in transformation functions.

Réponse à la question d'entretien

Utilisateur anonyme

5 juil. 2019

int atoi(const char* string) { int res = 0; while (*string) { res = res * 10 + (*string) - '0'; ++string; } return res; }

1