Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > One extern usage

Reply
Thread Tools

One extern usage

 
 
newsock
Guest
Posts: n/a
 
      10-22-2003
What's the implied meaning of using extern below?

extern int main(void)
{
...
}


 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      10-22-2003
newsock wrote:

> What's the implied meaning of using extern below?
>
> extern int main(void)
> {
> ...
> }


It's identical to:

int main(void)
{
...
}

and I presume you already know what that means.

--
Richard Heathfield : http://www.velocityreviews.com/forums/(E-Mail Removed)
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
 
Reply With Quote
 
 
 
 
Rick
Guest
Posts: n/a
 
      10-22-2003
Doesn't extern imply that the function or variable or whatever that's
being extern'd is externally defined some place? Does writing extern
like this have any possible side effects? What if it was written against
some variable?

Richard Heathfield wrote:
> It's identical to:
>
> int main(void)
> {
> ...
> }
>
> and I presume you already know what that means.
>



Thanks

Rick

 
Reply With Quote
 
Dan Pop
Guest
Posts: n/a
 
      10-22-2003
In <3f96460a$(E-Mail Removed)> Rick <rrquick@nospam-com> writes:

>Doesn't extern imply that the function or variable or whatever that's
>being extern'd is externally defined some place? Does writing extern
>like this have any possible side effects? What if it was written against
>some variable?


On function declarations/definitions, extern is the default and
explicitly mentioning it makes no differences.

On object declarations, extern prevents the declaration from becoming
a tentative definition.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: (E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference of extern short *x and extern short x[]? Andre C Programming 5 07-17-2012 07:38 PM
extern "c" usage?!! Medvedev C++ 3 07-07-2008 08:24 AM
extern usage for template instantiations sks C++ 3 12-03-2005 01:51 PM
extern const char * vs. extern const char []http://tinyurl.com/47e3k Thomas Matthews C++ 5 08-02-2004 10:36 AM
Need help on memory usage VS PF usage metfan Java 2 10-21-2003 01:58 PM



Advertisments