File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -292,3 +292,48 @@ int main()
292292....
293293====
294294
295+ [#examples_file]
296+ === Reading From and Writing To File
297+
298+ .This example shows how to read and write decimal values efficiently to and from file, rather than using `to_chars` and `from_chars`
299+ ====
300+ [source,c++]
301+ ----
302+ include::example$to_from_file.cpp[]
303+ ----
304+
305+ .Expected Output:
306+ ....
307+ Current value: 0.000506
308+ Value as bytes: 2dcd4c57
309+
310+ Current value: -3.808117e+34
311+ Value as bytes: c0ba1b75
312+
313+ Current value: -1.656579e-12
314+ Value as bytes: a9994703
315+
316+ Current value: 2.040449e+10
317+ Value as bytes: 349f2281
318+
319+ Current value: -5.16665e+43
320+ Value as bytes: c587e239
321+
322+ Current value: -9.25265e+32
323+ Value as bytes: c00e1e51
324+
325+ Current value: -5.766669e-11
326+ Value as bytes: aa57fe0d
327+
328+ Current value: -7.641908e+38
329+ Value as bytes: c2f49b34
330+
331+ Current value: 6.31977e+29
332+ Value as bytes: 3e606e9a
333+
334+ Current value: 9.210438e-24
335+ Value as bytes: 68ec8a46
336+
337+ Successfully recovered all values from file
338+ ....
339+ ====
You can’t perform that action at this time.
0 commit comments