Next: malloc.c Up: Program Listings Previous: Makefile

static.c


#include <stdio.h>

void stat();

main() {
    int counter;    /* loop counter */
    
    
    for (counter = 0; counter < 5; counter++) {
        stat();
    }
    
}

void stat()

{ int temporary = 1;
  static int permanent = 1;

        (void)printf("Temporary %d Permanent %d\n",
            temporary, permanent);
        temporary++;
        permanent++;
}


Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994