Which of the following function is correct in case of conversion of string digits into their integer value?
a) x =atoi(string)
b) x = stoi(string)
c) x = chartoint(string)
d) all of these
Answers
Answer:
(d) All of these is a correct answer.
Explanation:
atio (string):
atio stand for ASCII to integer. Atoi is a type of built-in function in C language that convert a string value into an integer value.The C language library has the atoi function in Stdlib.h.
stio(string):
stio stand for string to integer. It is type of built-in function in c language that convert sequence of string character into integer value. This function is define in library string.h.
chartoint(string):
It also convert ASCII values to integer.
(d) All of these
Explanation:
- atio(string):
atio stand for ASCII to integer. Atoi is a type of built-in function in C language that convert a string value into an integer value.The C language library has the atoi function in Stdlib.h.
- stio(string):
stio stand for string to integer. It is type of built-in function in c language that convert sequence of string character into integer value. This function is define in library string.h.
- chartoint(string):
It also convert ASCII values to integer.