external declarations of ptrs and arrays

Howard Melman hmelman at absolut.rtp.dg.com
Thu Aug 2 22:37:03 AEST 1990


In article <61 at iconsys>, bryan at iconsys (Bryan Cardoza) writes:
 >In article <674 at dg.dg.com> hmelman at absolut.rtp.dg.com (Howard Melman) writes:
 >I have the file declare.c:
 >
 >char temp[20]="blah";
 >
 >I have the file use.c:
 ...
 >extern char *temp;
 ...
 >This causes a core dump.  When I change my extern declaration in use.c to be:
 >
 >extern char temp[];
 >
 >the program works fine.  I was under the impression that the two
 >declarations were the same.  Help...
 
I originally posted this question, I know understand it.

To everyone who responded kindly I thank you.  To everyone else who
responded, I thank you too.  To the newsgroup I appologize for posting
something that is in the Frequently Asked Questions posting.  The
explanation in there is one of the best that I've read.  People might
want to look at it as several of the responses gave incorrect answers to
my problem.

To anyone who is thinking of posting to this newgroup with a question,
be very careful of your wording or else you will get many responces to
the wrong question, or just people annoyed at your ignorance.

To everyone that did answer, I'm sorry that I can send a mail reply to
you, but that is another problem I have to solve, thanks anyway.


Howard



More information about the Comp.lang.c mailing list