Ask Question
23 July, 05:05

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

+5
Answers (1)
  1. 23 July, 06:55
    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?
Find an answer to your question ✅ “Which C99 function can be used to convert a string to a double? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers