C
Chad
On pages 144 to 145 in the book "The C Programming Language" by K & R,
they have part of the following
#define HASHSIZE 101
static struct nlist *hastab[HASHSIZE];
struct nlist *lookup(char *s)
{
struct nlist *np;
for (np = hashtab[hash(s)]; np != NULL; np = np->next)
if (strcmp(s, np->name) == 0) // found
return np;
return NULL; /* not found*/
}
Wouldn't
struct nlist *np;
in lookup(), since it doesn't have the static keyword(?), be an
automatic variable in this case?
they have part of the following
#define HASHSIZE 101
static struct nlist *hastab[HASHSIZE];
struct nlist *lookup(char *s)
{
struct nlist *np;
for (np = hashtab[hash(s)]; np != NULL; np = np->next)
if (strcmp(s, np->name) == 0) // found
return np;
return NULL; /* not found*/
}
Wouldn't
struct nlist *np;
in lookup(), since it doesn't have the static keyword(?), be an
automatic variable in this case?