RECT rt;
GetClientRect(hDlg,&rt); //hDlg==핸들값

'기타 > API' 카테고리의 다른 글

wchar->double ,char->double 캐스팅  (1) 2011.02.07
주소록  (0) 2011.01.10
똑딱이  (0) 2011.01.05
[예비 21기 김동영] 주간 과제물 1차  (0) 2010.10.28
[예비 21기 김동영] 주간 계획서 1차  (0) 2010.10.27

strtod, wcstod

Convert strings to a double-precision value.
 
double strtod(
   const char *nptr,
   char **endptr 
);
double wcstod(
   const wchar_t *nptr,
   wchar_t **endptr 
);

Parameters

nptr
Null-terminated string to convert.
endptr
Pointer to character that stops scan.

Return Value

strtod returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/–HUGE_VAL. The sign of HUGE_VAL matches the sign of the value that cannot be represented. strtod returns 0 if no conversion can be performed or an underflow occurs.

wcstod returns values analogously to strtod. For both functions, errno is set to ERANGE if overflow or underflow occurs.

See _doserrno, errno, _sys_errlist, and _sys_nerr for more information on this and other return codes.

Remarks

Each function converts the input string nptr to a double. The strtod function converts nptr to a double-precision value. strtod stops reading the string nptr at the first character it cannot recognize as part of a number. This may be the terminating null character. wcstod is a wide-character version of strtod; its nptr argument is a wide-character string. Otherwise, these functions behave identically.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_tcstod strtod strtod wcstod

The LC_NUMERIC category setting of the current locale determines recognition of the radix character in nptr; for more information, see setlocale. If endptr is not NULL, a pointer to the character that stopped the scan is stored at the location pointed to by endptr. If no conversion can be performed (no valid digits were found or an invalid base was specified), the value of nptr is stored at the location pointed to by endptr.

strtod expects nptr to point to a string of the following form:

[whitespace] [sign] [digits] [.digits] [ {d | D | e | E}[sign]digits]

A whitespace may consist of space and tab characters, which are ignored; sign is either plus (+) or minus (); and digits are one or more decimal digits. If no digits appear before the radix character, at least one must appear after the radix character. The decimal digits can be followed by an exponent, which consists of an introductory letter (d, D, e, or E) and an optionally signed integer. If neither an exponent part nor a radix character appears, a radix character is assumed to follow the last digit in the string. The first character that does not fit this form stops the scan.

Requirements

Routine Required header Compatibility
strtod <stdlib.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP
wcstod <stdlib.h> or <wchar.h> ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

// crt_strtod.c
/* This program uses strtod to convert a
 * string to a double-precision value; strtol to
 * convert a string to long integer values; and strtoul
 * to convert a string to unsigned long-integer values.
 */

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

int main( void )
{
   char   *string, *stopstring;
   double x;
   long   l;
   int    base;
   unsigned long ul;
   string = "3.1415926This stopped it";
   x = strtod( string, &stopstring );
   printf( "string = %s\n", string );
   printf("   strtod = %f\n", x );
   printf("   Stopped scan at: %s\n\n", stopstring );
   string = "-10110134932This stopped it";
   l = strtol( string, &stopstring, 10 );
   printf( "string = %s\n", string );
   printf("   strtol = %ld\n", l );
   printf("   Stopped scan at: %s\n\n", stopstring );
   string = "10110134932";
   printf( "string = %s\n", string );
   /* Convert string using base 2, 4, and 8: */
   for( base = 2; base <= 8; base *= 2 )
   {
      /* Convert the string: */
      ul = strtoul( string, &stopstring, base );
      printf( "   strtol = %ld (base %d)\n", ul, base );
      printf( "   Stopped scan at: %s\n", stopstring );
   }
}

Output

string = 3.1415926This stopped it
   strtod = 3.141593
   Stopped scan at: This stopped it

string = -10110134932This stopped it
   strtol = -2147483648
   Stopped scan at: This stopped it

string = 10110134932
   strtol = 45 (base 2)
   Stopped scan at: 34932
   strtol = 4423 (base 4)
   Stopped scan at: 4932
   strtol = 2134108 (base 8)
   Stopped scan at: 932



출처 : http://msdn.microsoft.com/en-us/library/kxsfc1ab(VS.71).aspx

'기타 > API' 카테고리의 다른 글

창 크기 알아오기  (0) 2011.02.07
주소록  (0) 2011.01.10
똑딱이  (0) 2011.01.05
[예비 21기 김동영] 주간 과제물 1차  (0) 2010.10.28
[예비 21기 김동영] 주간 계획서 1차  (0) 2010.10.27

'기타 > API' 카테고리의 다른 글

창 크기 알아오기  (0) 2011.02.07
wchar->double ,char->double 캐스팅  (1) 2011.02.07
똑딱이  (0) 2011.01.05
[예비 21기 김동영] 주간 과제물 1차  (0) 2010.10.28
[예비 21기 김동영] 주간 계획서 1차  (0) 2010.10.27

'기타 > API' 카테고리의 다른 글

창 크기 알아오기  (0) 2011.02.07
wchar->double ,char->double 캐스팅  (1) 2011.02.07
주소록  (0) 2011.01.10
[예비 21기 김동영] 주간 과제물 1차  (0) 2010.10.28
[예비 21기 김동영] 주간 계획서 1차  (0) 2010.10.27

이번주 한일

 작성일 :       2010-10-29

 작성자 :         김 동영

날 짜

학습내용

예상소요시간

실제소요시간

10/25 월요일

API 1

(윈도우즈 프로그래밍)

3시간

3시간(100%)

10/27 수요일

API 2

(첫 번째 예제)

3시간

3시간(80%)

10/28 목요일

API 3

(출력)

3시간

 

 

화요일에 학과행사로 인해 참여를 못하여 수요일에 보고서 작성을

전달받아 1장의 공부내용을 정리하느냐고 계획했던 3장을 학습하지

못하였습니다. 1장에서 윈도우 프로그래밍의 특징과 역사를 알게되었고,

2장에서는 기본틀에 대해 알게 되었습니다.

신세계를 접하여 흥미를 가지고

공부중입니다.

'기타 > API' 카테고리의 다른 글

창 크기 알아오기  (0) 2011.02.07
wchar->double ,char->double 캐스팅  (1) 2011.02.07
주소록  (0) 2011.01.10
똑딱이  (0) 2011.01.05
[예비 21기 김동영] 주간 계획서 1차  (0) 2010.10.27

주간 보고서

 작성일 :       2010-10-27

 작성자 :         김 동영

날 짜

학습내용

예상소요시간

실제소요시간

10/25 월요일

API 1

(윈도우즈 프로그래밍)

3시간

3시간

10/27 수요일

API 2

(첫 번째 예제)

3시간

 

10/28 목요일

API 3

(출력)

3시간

 

 

 

본격적으로 API를 공부하기 앞서 25일에는 윈도우즈 프로그래밍이 무엇인지 기초부터 다져서 꼼꼼히 공부를 하고 27일에는 API예제를 통하여 API를 접해보고 28일에는 나아가 출력부분에 대해 공부할 계획입니다.

 

 

 

'기타 > API' 카테고리의 다른 글

창 크기 알아오기  (0) 2011.02.07
wchar->double ,char->double 캐스팅  (1) 2011.02.07
주소록  (0) 2011.01.10
똑딱이  (0) 2011.01.05
[예비 21기 김동영] 주간 과제물 1차  (0) 2010.10.28

+ Recent posts