Example 1 — Print a Line of Text
No is needed. Compile with -std=c++23.
#include <print>
int main() {
std::println("Hello, C++23!");
std::println("Second line");
return 0;
} How It Works
std::println("Hello, C++23!")prints the text and then a new line.- The second call starts on the next line, because the first one ended its line.
- With
std::printyou would have to write\nat the end of each text.

