Re: Why segfault and no NULL match in for loop?



CBFalconer <cbfalconer@xxxxxxxxx> writes:
[...]
NEVER define an actual object in a .h file. Doing so will cause it
to be multiply defined, and result in link or run time errors. Add
the word "extrn" to the definition, and delete the initialization.
Put the above structure in ONLY one of the files in which you
#include "search.h".

It's "extern", not "extrn".

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • Re: Order of execution question
    ... that you are initializing the variable on entry to the while loop. ... The local declaration and initialization of temp. ... Chuck F (cbfalconer at maineline dot net) ...
    (comp.lang.c)
  • Re: Having issues trying to copy an array
    ... CBFalconer writes: ... Initialization ... If an object that has static storage duration is not initialized ... -- if it has pointer type, it is initialized to a null pointer. ...
    (comp.lang.c)