Externs and prototypes.


R. Clayton (rclayton@clayton.cs.monmouth.edu)
Wed, 17 Jan 2001 19:01:09 -0500 (EST)


  The test driver refers to the homework function as:

    extern void delete_font(char *, unsigned);

  The Programming Assignment from your web site asked for the prototype:

    void disable_font(char*, unsigned);

  Which do you prefer?

>From the writer's point of view, there's no difference: the prototype is the
same in both cases. From the reader's point of view, I prefer using explicit
extern keywords to indicate "this identifier is not defined in this file".
Unfortunately, this meaning is not enforced in C++ (or C) because extern
identifiers can be defined in the same file as the extern statement (which, to
be fair, makes life much easier) and file-level identifiers without a
storage-class indicator default to extern.



This archive was generated by hypermail 2.0b3 on Thu May 17 2001 - 12:00:05 EDT