From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/string%2Fbyte%2Fstrfromf.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 devdocs/c/string%2Fbyte%2Fstrfromf.html (limited to 'devdocs/c/string%2Fbyte%2Fstrfromf.html') diff --git a/devdocs/c/string%2Fbyte%2Fstrfromf.html b/devdocs/c/string%2Fbyte%2Fstrfromf.html new file mode 100644 index 00000000..ce768ba4 --- /dev/null +++ b/devdocs/c/string%2Fbyte%2Fstrfromf.html @@ -0,0 +1,24 @@ +

strfromf, strfromd, strfromld

Defined in header <stdlib.h>
int strfromf( char *restrict s, size_t n, const char *restrict format, float fp );
+
(since C23)
int strfromd( char *restrict s, size_t n, const char *restrict format, double fp );
+
(since C23)
int strfroml( char *restrict s, size_t n, const char *restrict format, long double fp );
+
(since C23)

Converts a floating-point value to a byte string.

+

The functions are equivalent to snprintf(s, n, format, fp), except that the format string shall only contain the character %, an optional precision that does not contain an asterisk *, and one of the conversion specifiers a, A, e, E, f, F, g, or G, which applies to the type double, float, or long double) indicated by the function suffix (rather than by a length modifier). Use of these functions with any other format string results in undefined behavior.

+

Parameters

+ + + + +
s - pointer to a character string to write to
n - up to n - 1 characters may be written, plus the null terminator
format - pointer to a null-terminated byte string specifying how to interpret the data
fp - floating-point value to convert

Return value

The number of characters that would have been written had n been sufficiently large, not counting the terminating null character. Thus, the null-terminated output has been completely written if and only if the returned value is both nonnegative and less than n.

+

Example

Reference

See also

+ +
+
(C99)(C11)(C11)(C11)(C11)
prints formatted output to stdout, a file stream or a buffer
(function)
+
(C99)(C99)
converts a byte string to a floating point value
(function)
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/string/byte/strfromf +

+
-- cgit v1.2.3