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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:39:06+00:00 2026-06-03T08:39:06+00:00

I have the following; const CHAR string_1[] PROGMEM = String 1; const CHAR string_2[]

  • 0

I have the following;

const CHAR string_1[] PROGMEM = "String 1";
const CHAR string_2[] PROGMEM = "String 2";
const CHAR string_3[] PROGMEM = "String 3";
const CHAR string_4[] PROGMEM = "String 4";
const CHAR string_5[] PROGMEM = "String 5";

const CHAR *string_table[] PROGMEM  = 
{
    string_1,
    string_2,
    string_3,
    string_4,
    string_5
};

How would I save this address of string_table so I could call it in a function;

CHAR acBuffer[20];
UCHAR ucSelectedString = 2; // get string number 3
//
    pcStringTable = string_table ...?? What is the proper line here??
//
strcpy_P(acBuffer, (char*)pgm_read_byte(&(pcStringTable[ucSelectedString])))

Based on the comments below, I changed by structure too;

typedef struct
{
...
CHAR **pasOptions;

I then tried to assign string_table to it;

stMenuBar.pasOptions = string_table;

The compiler throws this warning;

warning: assignment from incompatible pointer type

Any more thoughts?

  • 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-03T08:39:08+00:00Added an answer on June 3, 2026 at 8:39 am

    string_table is an array of pointers to strings. An array can decay to a (one-dimensional, because that’s the only kind) pointer just fine.

    So an array to arrays of strings can be represented as a pointer [think: array] to (pointers of chars [think: strings]).

    const char **pcStringTable = string_table;
    

    Which you can then access as any other one-dimensional array:

    printf("%s", pcStringTable[2]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following string: const char *str = \This is just some random
i have the following code below: const char* timeformat = %Y-%m-%d %H:%M:%S; const int
I have a class: class foo { private: std::string data; public: foo &append(const char*
I have the following C function: int w_ei_connect_init(ei_cnode* ec, const char* this_node_name, const char
I have the following function: int strpos(const char *needle, const char *haystack) { int
I have the following code: glShaderSource(shader, 1, (const char **)data.c_str(), NULL); But it makes
I have following array, that I need to operate by hand on bitmaps. const
I have the following code that compiles and works well: template<typename T> T GetGlobal(const
I have the following code: template <class T> struct pointer { operator pointer<const T>()
Given the following methods: // Method 1 void add(const std::string& header, bool replace); //Method

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.