Mail Archives: djgpp/1997/02/28/15:06:03
Kurt Skauen wrote:
> I am not shure what the ansi-standard says about this, but I have
> never seen a compiler that treats foo[], as *foo in a declaration.
> But then again, I have not tried all compilers :)
A pointer is different from an array, so if you declare something as
extern char array[];
that is intrinsically different from
extern char *array;
If you nix and match the definitions and declarations, then you _will_ have
problems. Pointers and arrays are not the same.
Arrays are, however, implicitly turned into pointers when passed as
function arguments.
The short answer is: Declare things how you define them, and vice versa.
Whenever you're trying to be "tricky" or save some typing or save the
compiler some thinking about what it is you mean, it's likely you're doing
something wrong.
> How to kill a daemon: for(;0;)
Eh? That doesn't never executes the for statement.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"I am become death, / destroyer of worlds."
/ J. Robert Oppenheimer (quoting legend)
- Raw text -