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 1095775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:10:45+00:00 2026-05-17T00:10:45+00:00

What, exactly, is numbers in the following declaration, if it is not an address

  • 0

What, exactly, is numbers in the following declaration, if it is not an address constant?

int main() {
    int numbers[3] = {1,2,3};
    return 0;
}

Disassembling the program shows that 1, 2, and 3 are dynamically placed on the local stack space, rather than the whole array being treated as a constant. Hence, {1,2,3} does not have static storage duration, so numbers is not an address constant, as per the C99 spec.

C99, Section 6.6.9: “An address constant is a null pointer, a pointer to an lvalue designating an object of static storage duration, or a pointer to a function designator…”

However, adding the line numbers++ after the declaration causes the following compile error in GCC 4.1.2:

error: invalid lvalue in increment

So it is constant, but isn’t an address constant. Does anybody know the official name of this type of constant in C99 (or similar)?

  • 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-17T00:10:45+00:00Added an answer on May 17, 2026 at 12:10 am

    numbers is a non-constant, automatic, array variable of the function main.

    Because it is automatic and non-constant it can not have static storage.

    because it is an array variable (and not you’ll notice a pointer) it can not be incremented.

    Note that you can do

    int main() {
        int numbers[3] = {1,2,3};
        int *n = numbers+1;
        n++;
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying write a PHP regex to find numbers only that are exactly
Possible Duplicate: JavaScript: formatting number with exactly two decimals Now that I have got
If the itemcount property does not exactly match the number of indexed rows is
Possible Duplicate: Generating random numbers in Javascript I have the following code var randomnumber=Math.floor(Math.random()*101);
Consider the following simple code. struct test { test(int n):numelements(n){ arr = new int[numelements]
I have the following barcode that I need to validate via regex: TE1310 2000183B
I want to extract the numbers following client_id and id and pair up client_id
The following three pieces of code achieves exactly the same effect. Yet, when compiled
This c++ code prints out the following prime numbers: 3 5 7 11 13
So, I have the following line of code, that does a for loop and

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.