Question d’entretien chez Microsoft

Design a function that converts a string to an integer.