How can I convert any numbers, for example 822042461 (string-type) to 822042461 (double-type) in C++ ?? Thanks a real lot !
sscanf may be useful:
/* sscanf example */
#include <stdio.h>
int main ()
{
char sentence []="822042461";
double i;
sscanf (sentence,"%lf",&i);
printf ("%lf\n",i);
return 0;
}
$ gcc -o /tmp/test.exe /tmp/test.cpp
$ /tmp/test.exe
822042461.000000