需求:
- 將char、wchar、tchar轉換為unsigned long (下面以TCHAR為範例):
unsigned long len = 0; TCHAR queryBuf[32] = _T("6588775699"); len = _tcstoul(queryBuf,NULL,0);
其餘對應為:strtoul, _strtoul_l, wcstoul, _wcstoul_l - 將char、wchar、tchar轉換為unsigned long longg (下面以TCHAR為範例):
unsigned long long len = 0; TCHAR queryBuf[32] = _T("6588775699"); len = _tcstoui64(queryBuf,NULL,0);
其餘對應為:_strtoui64(), _wcstoui64() and _tcstoui64() - 而使用printf、sprintf的unsigned long long的對應format為%llu:
unsigned long long ll = 6588775699; TCHAR tszHeader[MAX_FILENAME_LEN] = {0}; _stprintf(tszHeader,_T("Range:bytes=%llu-"),ll);
沒有留言:
張貼留言