User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

Q&A is closed


Table of Contents


    #include <stdlib.h>
    double strtod(const char *str, char **endptr);

strtod converts a string into a double variable

strtod c code example

 * strtod example code
#include <stdio.h>
#include <stdlib.h>
int main ( void )
  char string[] ="2040 strtod string 5";
  char *endptr;
  double number;
  number = strtod(string, &endptr);
  printf("String is %s\n",string);
  printf("Double is %f\n", number);
  return 0;


  user@host:~$  ./strtod 
  String is 2040 strtod string 5
  Double is 2040.000000

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/stdlib.h/strtod.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz