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

  • SEARCH
  • Home
  • 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 8740591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:09:22+00:00 2026-06-13T11:09:22+00:00

With reference to the question Where in a declaration may a storage class specifier

  • 0

With reference to the question Where in a declaration may a storage class specifier be placed? I started analyzing the concept of declaration-specifiers and declarators. Following is the accumulation of my understanding.

Declarations

  • Generally, the C declarations follow the syntax of declaration-specifiers declarators;
  • declaration-specifiers comprises of type-specifiers , storage-class-specifiers and type-qualifiers
  • declarators can be variables,pointers,functions and arrays etc..

Rules that I assume

  • declaration-specifiers can be specified in any order, as an example
  • There cannot be more than a single storage-class-specifier
  • On the other hand there can be multiple type-qualifiers
  • storage-class-specifier shall not go with the declarator

Questions

Q1: In the declaration of a constant pointer, I see a mix of declarator and type-qualifier as below

const int *const ptr; //Need justification for the mix of declarator and type-specifier

Q2: There can be a pointer to static int. Is there a possibility of providing the pointer a static storage class? Means the pointer being static.

  • 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-06-13T11:09:23+00:00Added an answer on June 13, 2026 at 11:09 am

    I’m not sure I full understand you first question. In terms of C++03 grammar const is a cv-qualifier. cv-qualifier can be present in decl-specifier-seq (as a specific kind of type-specifier), which is a “common” part of the declaration, as well as in init-declarator-list, which is a comma-separated sequence of individual declarators.

    The grammar is specifically formulated that a const specifier belonging to an individual pointer declarator must follow the *. A const specifier that precedes the first * is not considered a part of the individual declarator. This means that in this example

    int const *a, *b;
    

    const belongs to the left-hand side: decl-specifier-seq, the “common” part of the declaration. I.e. both a and b are declared as int const *. Meanwhile this

    int *a, const *b;
    

    is simply ill-formed and won’t compile.

    Your second question doesn’t look clear to me either. It seems that you got it backwards. You claim that “there can be a pointer to static int“? No, there’s no way to declare such thing as “pointer to static int“. You can declare a static pointer to int though

    static int *p;
    

    In this case the pointer itself is static, as you wanted it to be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May be a stoopid question: I have a number of reference tables in an
Python docstrings that immediately follows the declaration of a class or function are placed
In reference with this question We have a header with a date picked component
With reference to the question I asked couple of days back, it seems to
With the reference to this question:- JavaScript -Change CSS color for 5 seconds Working
Reference: This is a self-answered question. It was meant to share the knowledge, Q&A
EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying
I have a question about a ForeignKey reference problem with django. This is a
This is with reference to the below question: Execute program from within a C
In reference to this answer to a Stack Overflow question : what is bench-testing

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.