WD interview question

Write a C function transfer a char string contains 0-9 into int