Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ll-xn!cullvax!drw From: drw@cullvax.UUCP Newsgroups: comp.lang.c Subject: arrays vs. pointers Message-ID: <904@cullvax.UUCP> Date: Wed, 11-Mar-87 19:15:21 EST Article-I.D.: cullvax.904 Posted: Wed Mar 11 19:15:21 1987 Date-Received: Fri, 13-Mar-87 00:05:39 EST Organization: Cullinet Software, Inc., Westwood, MA Lines: 27 bill@voodoo.UUCP (Bill Sears) writes: > in decl.c: > char Big_buf[512]; > > in main.c > main() > { > extern char *Big_buf; > int i; > > for (i = 0; i < 512; i++) > *(Big_buf + i) = 0; > } The linker should, ideally, reject this. If you want to say "extern char *Big_buf" then you have to say "char *Big_buf" where you define it. What you should say is "extern char Big_buf[]". Your second example (where both defintion and reference were in the second file) is probably invalid under any reasonably tight definition of the language, but you compiler happens to let you get away with it. Dale -- Dale Worley Cullinet Software UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw ARPA: cullvax!drw@eddie.mit.edu Un*x (a generic name for a class of OS's) != Unix (AT&T's brand of such)