IntTryToStrAlloc
Description
Convert an integer to a decimal string using an explicit allocator.
Parameters
| Name | Direction | Description |
|---|---|---|
out |
out | Destination string. |
value |
in | Integer to convert. |
alloc |
in | Allocator to bind to the produced string. |
Success
Returns true on success, false on allocation failure.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:1024:
*out = StrInit(alloc);
if (!IntTryToStrAlloc(&digits, &value->significand, alloc)) {
return false;
}- In
Io.c:2985:
if (radix == 10) {
if (!IntTryToStrAlloc(&temp, value, o->allocator)) {
return false;
}- In
Float.c:548:
}
if (!IntTryToStrAlloc(&digits, &value->significand, alloc)) {
return false;
}- In
Int.c:647:
}
bool IntTryToStrAlloc(Str *out, Int *value, Allocator alloc) {
return IntTryToStrRadixAlloc(out, value, 10, false, alloc);
}- In
Int.c:653:
bool IntTryToStr(Str *out, Int *value) {
ValidateInt(value);
return IntTryToStrAlloc(out, value, INT_BITS(value)->allocator);
}
Last updated on