Multiple choice technology programming languages

How to convert a string to integer?

  1. strtod()

  2. srttoi()

  3. atoi()

  4. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

atoi() is the standard C library function that converts a string representation of an integer to its int value. strtod() converts to double, srttoi() is a typo (likely meant strtol), and atoi is correct.