dibbsdibblz4390 dibbsdibblz4390
  • 07-08-2019
  • Computers and Technology
contestada

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

Respuesta :

Branta Branta
  • 17-08-2019

Answer:

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 <stdlib.h>

For example:

#include <stdio.h>

#include <stdlib.h>  

int main()

{

   char str[5] = "0.01";

   double d = atof(str);

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

   return 0;

}

Answer Link

Otras preguntas

How many letters are their in the alphabet
2/3 of a some of money is 48p. What is 5/8 of the sum of money?
Scott has 1/3 as many computer games as Anish, and Anish has 1/2 as many games as Nick. Together they have 140 games. How many do they have each? Scott has.....
Is burning a chemical reaction or a physical change? Tick one box.chemical change                               physical changeAnd then, explain why you chose y
multiplying polynomials(3m-1)(8m+7)
what is the measure of the amount of water in the air
how mANY PLANTES are there
Spawning is when a a. large group of adults release their gametes into the water at the same time. b. male and female fish release their gametes together. c. mal
What were the causes of WW1
Is burning a chemical reaction or a physical change? Tick one box.chemical change                               physical changeAnd then, explain why you chose y