https://rentry.org/PPP2_p297

// Code derived from Stroustrup's PPP2 book
// § 8.7.1 using declarations and using directives
//  -and beginning on p 297

// #include "../std_lib_facilities.h"

#include <iostream>
#include <string>

using namespace std;

int main()
{
  string name;
  cout << "Please enter your first name\n";
  cin >> name;
  cout << "Hello, " << name << '\n';
}

build & run:

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

PrevUp

Edit
Pub: 04 Apr 2023 15:29 UTC
Edit: 03 May 2023 00:55 UTC
Views: 368