https://rentry.org/PPP2_p45

// Code derived from Stroustrup's PPP2 book
// § 2.2 The classic first program
// -beginning on p 45

#include <iostream>

using std::cout;

// This program outputs the message “Hello, World!” to the monitor

int main()  // C++ programs start by executing the function main
{
  cout << "Hello, World!\n";  // output “Hello, World!”
  return 0;
}

build & run:

g++ -std=c++20 -O2 -Wall -pedantic ./ch_02/main_p45.cpp && ./a.out

UpNext

Edit
Pub: 16 Jan 2023 05:10 UTC
Edit: 21 Jan 2023 11:44 UTC
Views: 710