Elektrine lite

← Feed

@historicaldocuments@lemmy.world

Post #3214649

2026-06-09 06:15 UTC

Try the c++23 standard. There’s been a lot of cross pollination. Contrived example follows: #include #include #include #include int main(int argc, char *argv[]) { double pi = std::numbers::pi; std::string fstr = std::format("{}, {:>.2}, {:>.5}, {:>.10}", pi, pi, pi, pi); std::string h = "Hello"; std::string w = "World"; std::println("{}, {}!", h, w); std::print("This won't have a {},", "newline"); std::println(" but this will add it."); // Add a newline. // Can't put a non-constant string as the first argument to // print or println so they can be checked at compile time. std::println("{}", fstr); return EXIT_SUCCESS; }

Replies (0)

No replies.