1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

In summary:

  1. by default a procedure definition is exported to other
    files
  1. if static is used the procedure definition is local to the
    current file
  • By default, a variable is visible within its current
    scope, if a variable is defined inside a procedure it is only
    visible within that procedure
  • If a variable is defined outside a procedure, i.e., a global
    variable, it is visible to the entire program--it can be
    seen in the current file and any other file that is loaded
    with it.
  • If a global variable is defined with the static storage
    class it can only be seen within the current file - other
    files cannot reference this variable
  • A variable that is declared extern is defined in another
    file, but is referenced in the current file - C will not
    automatically provide declaration for external variables
    like it does for procedures

March 3, 1998

Page 16

C201/TAM