080. 문자열을 정수로 변환하기 4(strtoul)080. 문자열을 정수로 변환하기 4(strtoul)
Posted at 2011. 2. 9. 04:25 | Posted in Computer/초보자를 위한 C 언어 300제
#include <stdio.h>
#include <stdlib.h>
void main( void )
{
char *string = "11000";
char *stop;
int radix;
unsigned long value;
radix = 2;
value = strtoul( string, &stop, radix );
printf( "%d 개의 문자가 변환되었습니다. \n", stop - string );
printf( "2진수 %s를 숫자로 변환하면 %u입니다. \n", string, value );
}
'Computer > 초보자를 위한 C 언어 300제' 카테고리의 다른 글
| 082. 문자열을 실수로 변환하기 2(strtod) (0) | 2011.02.09 |
|---|---|
| 081. 문자열을 실수로 변환하기 1(atof) (0) | 2011.02.09 |
| 078. 문자열을 정수로 변환하기 2(atol) (0) | 2011.02.09 |
| 076. 문자열을 형식화하기(sprintf) (0) | 2011.02.09 |
| 075. 문자열을 중복 생성하기(strdup) (0) | 2011.02.09 |
