https://rentry.org/PPP2_p75a

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

#include <iostream>

using std::cout;

int main()
{
  int x                  = 1;
  int number_of_elements = 1;
  int Fourier_transform  = 1;
  int z2                 = 1;
  int Polygon            = 1;

  cout << x << '\n'  // output above variable values to console...
       << number_of_elements << '\n'  //
       << Fourier_transform << '\n'   //
       << z2 << '\n'                  //
       << Polygon << '\n';

  // int 2x;              // a name must start with a letter
  // int time$to$market;  // $ is not a letter, digit, or underscore
  // int Start menu;      // space is not a letter, digit, or underscore
}

build & run:

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

PrevUpNext

Edit
Pub: 18 Jan 2023 08:18 UTC
Edit: 29 Apr 2023 06:24 UTC
Views: 471