본문 바로가기

Native/C

strtod()

#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( "16진수 %s를 숫자로 변환하면 %E입니다. \n", string, value );
}

'Native > C' 카테고리의 다른 글

memcmp()  (0) 2013.10.02
swab()  (0) 2013.10.02
strtol()  (0) 2013.10.02
netinet/in.h Header file  (0) 2013.10.02
[gcc] simple_ftp client  (0) 2013.10.02