char str[20] = "98993489"; scanf_s("%s", &str,20); //strcpy_s(str, "98993489"); float val = atof(str); cout << val << endl;
#include<stdlib.h> #include<stdio.h> int main() { double d; char str[34] ; scanf("%s", &str); d=atof(str); printf("string=%sdouble=%lf\n",str,d); return 0; }