/* wcstoll example */ #include <wchar.h> int main () { wchar_t wsNumbers[] = L"1856892505 17b00a12b -01100011010110000010001101100 0x6fffff"; wchar_t * pEnd; long long int lli1, lli2, lli3, lli4; lli1 = wcstoll (wsNumbers,&pEnd,10); lli2 = wcstoll (pEnd,&pEnd,16); lli3 = wcstoll (pEnd,&pEnd,2); lli4 = wcstoll (pEnd,NULL,0); wprintf (L"The decimal equivalents are: %lld, %lld, %lld and %lld.\n", lli1, lli2, lli3, lli4); return 0; } |
The decimal equivalents are: 1856892505, 6358606123, -208340076 and 7340031 |
strtoll | 将字符串转换为 long long integer(function ) |
wcstol | 将宽字符串转换为 long integer (function ) |
wcstod | 将宽字符串转换为double (function ) |
wcstoull | 将宽字符串转换为 unsigned long long integer(function ) |