By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,376 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,376 IT Pros & Developers. It's quick & easy.

default storage class specifier of a variable

P: n/a

I know java,but I am just beginner in C.I have some confusions
regarding extern storage specifier and default storage class specifier
for a variable when it has file scope that is ,when it is not
defined within
any block

--
Posted via http://dbforums.com
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sat, 05 Jul 2003 06:05:07 +0000, ravi_shankar
<me*********@dbforums.com> wrote in comp.lang.c:

I know java,but I am just beginner in C.I have some confusions
regarding extern storage specifier and default storage class specifier
for a variable when it has file scope that is ,when it is not
defined within
any block


The "extern" keyword is not a storage specifier, although it has some
restrictions as to the storage duration of the objects with which it
can be used. The "extern" keyword specifies that an object or
function has external linkage, which means that it can be referred to
by name from translation units other than the one it was defined in.

As to storage duration, all objects defined at file scope have static
storage duration. They also have external linkage unless defined
specifically with the keyword "static", which gives them internal
linkage.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.