home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!munnari.oz.au!spool.mu.edu!torn!csd.unb.ca!news.ucs.mun.ca!pico.engr.mun.ca!bibhas
- From: bibhas@pico.engr.mun.ca (Bibhas Bhattacharya)
- Subject: extern: interesting case...
- Message-ID: <bibhas.726341439@femto.engr.mun.ca>
- Keywords: extern
- Sender: usenet@news.ucs.mun.ca (NNTP server account)
- Organization: Memorial University of Newfoundland
- Date: Wed, 6 Jan 1993 17:30:39 GMT
- Lines: 18
-
- When I declare:
- extern char line[];
- for the variable "line" which was defined in another file as:
- char line[80];
- everything works fine. But when I do:
- extern char *line;
- the program dumps core. I can't figure out the difference, especially when
- extern declaration is not supposed to reserve any memory or anything. When
- I looked up K&R, the correct declaration would be: extern char line[];.
-
- Can anyone please clarify the case.
- Thanks.
- Bibhas
- --
- +==========================+=========================+
- | login name: DR. Jackyl | In real life: Mr. Hyde.|
- +==========================+=========================+
- bibhas@pico.engr.mun.ca
-