Desc :

double strtod( const char* string, char **stop );

string - 지수가 포함된 문자열

stop - 변환이 되다가 멈춰진 위치의 포인터 값

 


Source Code :

#include <stdio.h>
#include <stdlib.h>

void main()
{
	char *string = "1.234E-10";
	char *stop;
	double value;

	value = strtod(string, &stop);

	printf("%d개의 문자가 변환되었습니다\n", stop - string);
	printf("문자열 [%s]를 숫자로 변환하면 %E입니다.\n", string, value);

}

 


Result :

+ Recent posts