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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:38:23+00:00 2026-05-30T11:38:23+00:00

for each letter in the alphabet i have an int-array declared like this: int

  • 0

for each letter in the alphabet i have an int-array declared like this:

int const  A[64] ={ 
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    0,1,1,1,0,0,0,0,
    0,1,0,1,0,0,0,0,
    0,1,1,1,0,0,0,0,
    0,1,0,1,0,0,0,0,
    0,1,0,1,0,0,0,0,
    0,0,0,0,0,0,0,0
};

then i create another array with pointers to these.

int const * text[] = { A, B, C };

this works fine, until that text array reaches a certain number of different entries.

for example this works:

int const * text[] = { A, A, A, A, A, A, A, A }; // could even go on much longer

but this crashes:

int const * text[] = { A, B, C, D }; // it seems the number of different entries matters

why is that? i thought that if it is pointers, then it should not matter what it points to it will always be of constant size?

note that this is run on the arduino platform, which has very limited memory.

  • 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-30T11:38:24+00:00Added an answer on May 30, 2026 at 11:38 am

    I suspect that lookup into an array with identical elements is being optimized; If int const *text[]; were declared in a header file and compiled (defined) in a separate object file, you would likely see the same problem. The linker is doing the best it can, but all that data is likely overlapping with the heap / stack space.

    At least with avr-libc (using avr-gcc, avr-binutils), there are macros, or variable attributes, that can place this sort of constant data in the much larger, read-only program space (flash ROM).

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

Sidebar

Related Questions

I would like to have this: Using XSLT, put each letter of the alphabet
I have a link_to method in rails for each letter of the alphabet (early
This is kinda confusing so please bear with me. I have an array (listOfStates)
I have a page with 26 sections - one for each letter of the
I have this piece of code for placing elements from an array into the
In viewDidLoad I have created 26 UILabels programmatically (one for each letter in the
I have an array that looks something like: status[0] = true status[1] = true
Experts, I'm creating a glossary that has each letter of the alphabet as a
Intention In my Django template, I create a link for each letter in the
I need a way to allow each letter of a word to rotate through

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.