home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19317 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.1 KB  |  30 lines

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