# include # include using namespace std; # include "counter.hpp" //****************************************************************************80 void counter ( ) //****************************************************************************80 // // Purpose: // // counter() simply reports how many times it has been called. // // Discussion: // // If you can get a function like this to work, you have made a good // start at implementing persistent data. // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 12 May 2021 // // Author: // // John Burkardt // // Local static: // // int CALLS: the number of calls. // { static int calls = 0; // // Increment CALLS. // calls = calls + 1; // // Print it. // cout << "counter() has been called " << calls << " times.\n"; return; }