[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/c/string/byte/strtol [Back]  [Original]

strtol, strtoll cppreference.com
cppreference.com

strtol, strtoll

cppreference.com
< c | string | byte

<metanoindex/>

<tbody> </tbody>
<stdlib.h>
long strtol( const char *str, char **str_end, int base );
long long strtoll( const char *str, char **str_end, int base );
( C99)
, str.
:
Interprets an integer value in a byte string pointed to by str.
Google.
. .

( isspace) , , -n ( n=base) . :

  • ()
  • () (0), (, 8 0)
  • () (0x 0X), (, 16 0)
  • .

{0,2,3,...,36}. 2 {0,1}, 3 {0,1,2}, . , 10, , Aa 11, Zz 36. .

C.

base 0, : 0, , 0x 0X, , .

, , , , .

str_end . str_end NULL, .
:
The functions sets the pointer pointed to by str_end to point to the character past the last character interpreted. If str_end is NULL, it is ignored.
Google.
. .
str , , ( str_end NULL) str , str_end.
:
If the str is empty or does not have the expected form, no conversion is performed, and (if str_end is not NULL) the value of str is stored in the object pointed to by str_end.
Google.
. .

str
:
pointer to the null-terminated byte string to be interpreted
Google.
. .
str_end
.
:
pointer to a pointer to character.
Google.
. .
base
'
:
base of the interpreted integer value
Google.
. .

.


() []

() []
C++ strtol, strtoll

Web Proxy Viewer  |  New URL  |  Original Page