Ask Question
10 November, 23:32

Which C99 function can be used to convert a string to a double?

+5
Answers (1)
  1. 11 November, 01:49
    0
    atof

    Explanation:

    atof function is used to convert a string to a double.

    It takes a single parameter of type const char * and returns a double value.

    The function signature is: double atof (const char * str);

    In order to use this function in the code, you need to include the header file

    For example:

    #include

    #include

    int main ()

    {

    char str[5] = "0.01";

    double d = atof (str);

    printf ("Value = %f/n", d);

    return 0;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which C99 function can be used to convert a string to a double? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers