C++ inherits most of C's syntax and the C preprocessor. The following is Bjarne Stroustrup's version of the Hello world program which uses the C++ standard library stream facility to write a message to standard output:[7][8]
#include
int main()
{
std::cout << "Hello, world!\n";
}
Returning a value from the 'main' function is completely optional.[9] For all other value-returning functions, failing to do so results in undefined behavior if control reaches the end of the function.[10]
No comments:
Post a Comment