https://rentry.org/PPP2_p76

// Code derived from Stroustrup's PPP2 book
// § 3.7 Names
// -beginning on p 76

#include <iostream>

using std::cout;

int main()
{
  // int if                                   = 7;  // error: if is a keyword
  // int string                               = 7;  // this will lead to trouble
  int mtbf                                 = 7;
  int TLA                                  = 7;
  int myw                                  = 7;
  int NBV                                  = 7;
  int partial_sum                          = 7;
  int element_count                        = 7;
  int stable_partition                     = 7;
  int the_number_of_elements               = 7;
  int remaining_free_slots_in_symbol_table = 7;

  cout << mtbf << '\n'           // output above variable values to console...
       << TLA << '\n'            //
       << myw << '\n'            //
       << NBV << '\n'            //
       << partial_sum << '\n'    //
       << element_count << '\n'  //
       << stable_partition << '\n'        //
       << the_number_of_elements << '\n'  //
       << remaining_free_slots_in_symbol_table << '\n';
}

build & run:

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

PrevUpNext

Edit
Pub: 19 Jan 2023 08:29 UTC
Edit: 29 Apr 2023 06:27 UTC
Views: 592