Student Project
2024-11-29 05:49:38 UTC
Reply
Permalinkstd::vector<int> v = {1, 2, 3, 4, 5};
std::println("{}", v);
Suppose you want it to be centered in a line of 40 characters, with
underscore characters around it:
std::vector<int> v = {1, 2, 3, 4, 5};
std::println("{:_^40}", v);
// ____________[1, 2, 3, 4, 5]_____________
Source:
<https://isocpp.org/blog/2024/11/having-fun-with-modern-cpp-daniel-lemire>
Thank you for reading this and possible solution.