default storage class specifier of a variable

Discussion in 'C Programming' started by ravi_shankar, Jul 5, 2003.

  1. ravi_shankar

    ravi_shankar Guest

    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
     
    ravi_shankar, Jul 5, 2003
    #1
    1. Advertising

  2. ravi_shankar

    Jack Klein Guest

    On Sat, 05 Jul 2003 06:05:07 +0000, ravi_shankar
    <> 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
     
    Jack Klein, Jul 5, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ravi_shankar

    extern storage class specifier for variables

    ravi_shankar, Jul 4, 2003, in forum: C Programming
    Replies:
    6
    Views:
    2,692
    Mark McIntyre
    Jul 4, 2003
  2. aruna
    Replies:
    14
    Views:
    1,922
    Case -
    Apr 29, 2004
  3. sarathy
    Replies:
    2
    Views:
    666
    sarathy
    Jul 17, 2006
  4. sunny

    why Typedef is storage class specifier?

    sunny, Oct 16, 2006, in forum: C Programming
    Replies:
    1
    Views:
    412
    Keith Thompson
    Oct 16, 2006
  5. Sourabh Daptardar

    Storage class specifier of class members

    Sourabh Daptardar, Jun 5, 2008, in forum: C++
    Replies:
    4
    Views:
    333
    James Kanze
    Jun 7, 2008
Loading...

Share This Page