⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strtoumx.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
字号:
.func strtoumax wcstoumax _ustrtoumax
#include <inttypes.h>
uintmax_t strtoumax( const char *ptr,
                     char **endptr,
                     int base );
.ixfunc2 '&Conversion' &func
.if &'length(&wfunc.) ne 0 .do begin
#include <inttypes.h>
uintmax_t wcstoumax( const wchar_t *ptr,
                     wchar_t **endptr,
                     int base );
.ixfunc2 '&Conversion' &wfunc
.ixfunc2 '&Wide' &wfunc
.do end
.if &'length(&ufunc.) ne 0 .do begin
uintmax_t _ustrtoumax( const wchar_t *ptr,
                       wchar_t **endptr,
                       int base );
.ixfunc2 '&Conversion' &ufunc
.do end
.funcend
.desc begin
The &func function converts the string pointed to by
.arg ptr
to an
.id uintmax_t.
The function recognizes a string containing optional white space,
an optional sign (+ or -),
followed by a sequence of digits and letters.
The conversion ends at the first unrecognized character.
A pointer to that character will be stored in the object
.arg endptr
points to if
.arg endptr
is not
.mono NULL.
.np
If
.arg base
is zero, the first characters determine the base used for the
conversion.
If the first characters are "0x" or "0X" the digits are treated as
hexadecimal.
If the first character is '0', the digits are treated as octal.
Otherwise the digits are treated as decimal.
.np
If
.arg base
is not zero, it must have a value of between 2 and 36.
The letters a-z and A-Z represent the values 10 through 35.
Only those letters whose designated values are less than
.arg base
are permitted.
If the value of
.arg base
is 16, the characters "0x" or "0X" may optionally precede the sequence
of letters and digits.
.np
If there is a leading minus sign in the string, the value is negated.
.im widefunc
.im unifunc
.desc end
.return begin
The &func function returns the converted value.
If the correct value would cause overflow,
.kw UINTMAX_MAX
is returned and
.kw errno
is set to
.kw ERANGE.
If
.arg base
is out of range, zero is returned and
.kw errno
is set to
.kw EDOM.
.return end
.see begin
.im seestoi &function.
.see end
.exmp begin
#include <inttypes.h>
#include <stdlib.h>

void main()
{
    uintmax_t v;
.exmp break
    v = strtoumax( "12345678909876", NULL, 10 );
}
.exmp end
.class ANSI
.system

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -