How to convert a string to integer?
-
strtod()
-
srttoi()
-
atoi()
-
None of these
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.