082. 문자열을 실수로 변환하기 2(strtod)082. 문자열을 실수로 변환하기 2(strtod)

Posted at 2011. 2. 9. 04:31 | Posted in Computer/초보자를 위한 C 언어 300제
#include <stdio.h>
#include <stdlib.h>

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

	value = strtod( string, &stop );

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