default storage class specifier of a variable

R

ravi_shankar

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
 
J

Jack Klein

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top