Header Reference: <print>
Header Reference: <print>
The formatted output helpers std::print and related print-oriented facilities in modern C++.
Header Reference: <print>
The formatted output helpers std::print and related print-oriented facilities in modern C++.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<print>std::printstd::println<format> with a shorter printing path#include <print>
int main() {
std::println("status = {}", 42);
}
Use <print> when you want formatting plus immediate output in one step instead of building a formatted string first.
std::print or std::println for direct formatted output<format> when you need to build, store, or further process the formatted string before printing<print> for straightforward terminal or log-style emission rather than complex output pipelines#include <print>
int main() {
std::println("answer = {}", 42);
return 0;
}