https://rentry.org/PPP2_p115

// Code derived from Stroustrup's PPP2 book
// § 4.5 Functions
//  -and beginning on p 115

#include <iostream>

using std::cout;

void write_sorry()  // take no argument; return no value
{
  cout << "Sorry\n";
}

int main() { write_sorry(); }

build & run:

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

PrevUpNext

Edit
Pub: 04 Feb 2023 00:29 UTC
Edit: 29 Apr 2023 08:29 UTC
Views: 432