Format the specified character value into [first, last)].
Synopsis
Declared in <bslalg_numericformatterutil.h>
static
char*
toChars(
char* first,
char* last,
char value,
int base = 10) noexcept;
Description
Write the specified integral value into the character buffer starting at the specified first and ending at the specified last, last not included. If the optionally specified base argument is not present base 10 is used. Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or 0 on failure. The only reason for failure is when the range [ first, last )] is not large enough to contain the result. The written result is to begin at first with leftover room following the return value. The behavior is undefined unless first <= last, and base is in the range [ 2 .. 36 ]. Note that the type bool for the value parameter is explicitly disabled in the "NOT IMPLEMENTED" private section, because bool would otherwise be promoted to int and printed as 0 or 1, instead of the (possibly) expected false and true; and bool is not an integral or numeric type either. Also note that these functions do not null‐terminate the result.
Return Value
pointer past the last character written, or null on failure
Parameters
Name |
Description |
first |
beginning of the output character range |
last |
end of the output character range |
value |
integer value to format |
base |
numeric base for formatting |
Created with MrDocs