// File: staticcons.C // // When are the constructors for global variables called? #include #include "record.h" // Global variable Record g ; void foo() { static Record x(5, 'c') ; printf (" Inside function foo\n") ; printf (" Record x ") ; x.id() ; return ; } main() { printf("First statement in main()\n") ; printf ("Call foo() once\n") ; foo() ; printf ("Call foo() again\n") ; foo() ; printf("Last statement in main()\n") ; }