Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to work with arrays of strings in the C framework
#2
The issue seems to occur when const char * dialogueTest[] is defined as a global variable.  In that case, it doesn't retrieve the string in the position specified.  If dialogueTest is defined inside of the function that calls it, it works... why would that be?

Edit: It works as a global variable when defined as:
const char* const dialogueTest[3] = {
  "Line 1 of text",
  "Line 2 of text",
  "Line 3 of text",
};
Reply


Messages In This Thread
RE: How to work with arrays of strings in the C framework - by winteriscoming - 01-31-2023, 06:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)