Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3287968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:33:13+00:00 2026-05-17T20:33:13+00:00

Section 7.1 of the C++ Standard mentions about ‘extern’ as a storage class specifier.

  • 0

Section 7.1 of the C++ Standard mentions about ‘extern’ as a storage class specifier.

N3126 – “The extern specifier can be
applied only to the names of variables
and functions. The extern specifier
cannot be used in the declaration of
class members or function parameters.
For the linkage of a name declared
with an extern specifier, see 3.5. [
Note: The extern keyword can also be
used in explicit-instantiations and
linkage-specifications, but it is not
a storage-class-specifier in such
contexts. —end note ]

I understand about this keyword and it’s use in the context of ‘linkage specification’, but I am unable to get a grasp on the use of ‘extern’ as a storage specifier.

  1. Don’t all ‘extern’ names have static storage duration?
  2. If Answer to 1 is yes, then why this redundancy? C Compatibility?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:33:14+00:00Added an answer on May 17, 2026 at 8:33 pm

    extern is a storage class specifier. This is just a fact of the language grammar. extern has a number of effects on the semantics of a program depending on where it is used. It doesn’t have the single same effect everywhere. It influences the storage duration and linkage of objects and it also helps determine whether some declarations are also definitions or not.

    E.g.:

    int a; // Ex1
    
    extern int b; // Ex2
    

    For example, if Ex1 and Ex2 where at global scope then they would both refer to objects with static storage duration and external linkage. In C++, though, the first would be a definition (tentative definition in C) and the second would not. In this example extern has not changed the storage duration or linkage of the declared object.

    If Ex1 and Ex2 occurred in a function body then a would refer to an object with automatic storage duration and no linkage but b would refer to an object with external linkage and static storage duration. In this example, extern has affected the meaning of the declaration in both linkage, storage duration and whether or not it is a definition.

    Finally, in C++, here is an example where the only effect of extern is changing the linkage from internal to external.

    const int c = 5; // static storage duration, internal linkage
    
    extern const int d = 10; // static storage duration, external linkage
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the C++11 standard, Section 23.3.6.2 [vector.cons], the following is said: template <class InputIterator>
In the C++11 standard, section 1.10/5 mentions, but does not formally define the terms
Is the following standard conforming? Can you cite the section? struct A { virtual
To begin with, I know about C++ Standard (ISO/IEC 14882:2003): Section 11.5, Paragraph 1
Is there any class in the .NET framework that can read/write standard .ini files:
The C++0x standard working draft states (section 6.5.4) the following about the begin() and
Section 7.1.6 of the Modeshape docs say 'Your application can now create and remove
See section /* Common Classes */ of this page. http://webdesign.about.com/od/css/a/master_stylesht_2.htm are these css classes
The Images section of the following document https://developers.google.com/apps-script/html_service says that only images hosted on
In the section covering setlocale, the ANSI C standard states in a footnote that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.