Ask Question

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

+1
Answers (1)
  1. 16 July, 23:12
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers