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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:18:42+00:00 2026-06-17T06:18:42+00:00

I am using AVR-GCC version 4.7.0, and when I attempt to create an array

  • 0

I am using AVR-GCC version 4.7.0, and when I attempt to create an array of strings in FLASH memory I get the error:

variable ‘menu’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’

I am using this code:

const char menu0[] PROGMEM = "choice0";
const char menu1[] PROGMEM = "choice1";
const char menu2[] PROGMEM = "choice2";
const char menu3[] PROGMEM = "choice3";
const char menu4[] PROGMEM = "choice4";
const char menu5[] PROGMEM = "choice5";

const char *menu[] PROGMEM = {menu0, menu1, menu2, menu3, menu4, menu5};

I have already read Stack Overflow question C – how to use PROGMEM to store and read char array, but all the answers I see don’t include the const keyword which makes me believe that they were written before it was needed.

How does one fix this problem?


const char * const menu[] PROGMEM = {menu0, menu1, menu2, menu3, menu4, menu5};

was the answer.

  • 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-17T06:18:44+00:00Added an answer on June 17, 2026 at 6:18 am

    Try

    const char* const menu[] PROGMEM...
    

    Thus the array itself is constant, not a mutable array of const char* pointers, as it were in the original code.

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

Sidebar

Related Questions

In order to ensure that some initialization code runs before main (using Arduino/avr-gcc) I
Using Java Reflection, is it possible to get the name of a local variable?
I'm compiling on the command line with avr-gcc One of the includes I'm using
Background: I am developing a largish project using at Atmel AVR atmega2560. This project
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I have a binary file that I've disassembled using avr-objcopy. The interrupt vector table
I'm trying to implement the producer-consumer algorithm on ATMega323_WinAVR using FreeRTOS. I get this
I am using EVK1105 development board with AVR Studio 5 as development IDE for
Using Android NDK is it possible (from native C-code) to get a list of

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.