MCPcopy Create free account
hub / github.com/Extra-Creativity/Modern-Cpp-Basics / checkToChars

Function checkToChars

08-String & Stream/code/Profile.cpp:68–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static void checkToChars(int num)
69{
70 for (int idx = 0; idx < num; ++idx)
71 {
72 int i = 42;
73 double d = 7.7;
74 char buf[100] = { '?', '?', '?', '?', '?', '?', '?',
75 '?', '?', '?', '?', '?', '?' };
76 std::to_chars_result res = std::to_chars(buf, buf + 9, i);
77 *res.ptr = ' ';
78 res = std::to_chars(res.ptr + 1, res.ptr + 10, d);
79 *res.ptr = '\0';
80 if (num == 1)
81 {
82 std::cout << buf << '\n';
83 return;
84 }
85 }
86}
87
88static void checkFormat(int num)
89{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected