#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
¯\_(ツ)_/¯I'm fairly sure that all existing C compilers will quietly accept "int main()", but there's an argument that "int main()" causes the program to have undefined behavior. "int main(void)" is the form documented in the standard.
And the "return 0;" is unnecessary both in C++ and in all versions of C starting with C99. (Some will argue that it's better style to be explicit.)
These are admittedly minor points.
Is that really the hello world of c++ though?
It's a bit long in the tooth perhaps, bit I think still highlights some differences between C and C++: "Learning Standard C++ as a New Language":
https://www.stroustrup.com/new_learning.pdf
Ed: I suppose if you want to throw out a lot of c++, then the article might not apply...
import std;
int main()
{
std::println("hello, world");
}
Although your point stands, that is also valid C++.