Datasheet
The C and C++ Libraries
4-100 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
4.14.2 strtoll()
The
strtoll()
function converts a string in an arbitrary base to an integer, similar to the
ANSI function
strtol()
, but returning a
long long
result. Like
strtol()
, the parameter
endptr
can point to a location in which to store a pointer to the end of the translated
string, or can be
NULL
. The parameter
base
must contain the number base. Setting
base
to zero indicates that the base is to be selected in the same way as
atoll()
.
Syntax
longlong strtoll(const char *nptr, char **endptr, int base)
4.14.3 strtoull()
strtoull()
is exactly the same as
strtoll()
, but returns an
unsigned long long
.
Syntax
unsigned long long strtoull(const char *nptr, char **endptr, int base)
4.14.4 snprintf()
snprintf()
worksalmost exactly like the ANSI
sprintf()
function, except that the caller
can specify the maximum size of the buffer. The return value is the length of the
complete formatted string that would have been written if the buffer were big enough.
Therefore, the string written into the buffer is complete only if the return value is at least
zero and at most
n-1
.
The
bufsize
parameter specifies the number of characters of
buffer
that the function can
write into, including the terminating null.
<stdio.h>
is an ANSI header file, but the function is not allowed by the ANSI C library
standard. It is therefore not available if you use the compilers with the
-strict
option.
Syntax
int snprintf(char *buffer, size_t bufsize, const char *format, ...)
4.14.5 vsnprintf()
vsnprintf()
worksalmost exactly like the ANSI
vsprintf()
function, except that the
caller can specify the maximum size of the buffer. The return value is the length of the
complete formatted string that would have been written if the buffer were big enough.
Therefore, the string written into the buffer is complete only if the return value is at least
zero and at most
n-1
.