# include # include # include "counter.h" /******************************************************************************/ void counter ( ) /******************************************************************************/ /* 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. */ printf ( "counter() has been called %d times\n", calls ); return; }