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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:59:56+00:00 2026-05-12T17:59:56+00:00

I have a table that defines symbols appearance on a 5×7 dot display. Something

  • 0

I have a table that defines symbols appearance on a 5×7 dot display. Something like:

extern UINT8 symbols[][5] = {
    {0x0,0x0,0x0,0x0,0x0},
    {0x0,0x0,0x5F,0x0,0x0},
    {0x0,0x7,0x0,0x7,0x0},
    {0x14,0x7F,0x14,0x7F,0x14}, // etc.

The leading part of the table matches ASCII table, followed by a set of special symbols, e.g. an arrow, or a check-mark. To reference those I have a list of macros:

#define SYMBOL_LEFT_ARROW 120 // 120 is the entry in the table
#define SYMBOL_RIGHT_ARROW (SYMBOL_LEFT_ARROW+1)    
#define SYMBOL_UP_ARROW (SYMBOL_RIGHT_ARROW+1)

Now I need to say something like (won’t compile):

const char * const message = "Next" + SYMBOL_RIGHT_ARROW;

Question: How do I turn SYMBOL_RIGHT_ARROW into “\x79”, or whole string into "Next\x79" AT COMPILE TIME so I can have the string in R/O section?

Freescale HC08 C-compiler.

  • 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-12T17:59:57+00:00Added an answer on May 12, 2026 at 5:59 pm

    You can concatenate strings in C source:

    printf("%s\n", "forty" "two"); /* prints "fortytwo" */
    /* NOTE:             ^^^ no punctuation */
    

    To do that with your symbols is a lot of work, but maybe you can live with that.

    #define SYMBOL_LEFT_ARROW 120
    #define SYMBOL_LEFT_ARROW_STR "\x79"
    #define SYMBOL_RIGHT_ARROW (SYMBOL_LEFT_ARROW + 1)
    #define SYMBOL_RIGHT_ARROW_STR "\x83"
    const char * const message = "Next" SYMBOL_RIGHT_ARROW_STR;
    

    UPDATE

    If you can make the value of the symbol match its position in the symbol table (120 match “\x78”), try these macros

    #include <stdio.h>
    
    #define ADD_ZERO_X(y) 0x ## y
    #define SYMBOL_NUM(x) ADD_ZERO_X(x)
    
    #define STRINGIZE(z) #z
    #define ADD_SLASH_X(y) STRINGIZE(\x ## y)
    #define SYMBOL_STR(x) ADD_SLASH_X(x)
    
    #define SYMBOL_LEFT_ARROW 78 /* must write in hexadecimal without any prefix */
    #define SYMBOL_RIGHT_ARROW 79
    #define SYMBOL_UP_ARROW 7a
    
    int main(void) {
      printf("%d\n", SYMBOL_NUM(SYMBOL_LEFT_ARROW));
      printf("%s\n", SYMBOL_STR(SYMBOL_LEFT_ARROW));
      printf("%d\n", SYMBOL_NUM(SYMBOL_RIGHT_ARROW));
      printf("%s\n", SYMBOL_STR(SYMBOL_RIGHT_ARROW));
      printf("%d\n", SYMBOL_NUM(SYMBOL_UP_ARROW));
      printf("%s\n", SYMBOL_STR(SYMBOL_UP_ARROW));
      return 0;
    }
    

    Edit (SO doesn’t like my browser)

    After macro expansion SYMBOL_NUM(32) is transformed to a integer literal (0x78); and SYMBOL_STR(78) is transformed to a string literal ("\x78").

    You can use the literals as if you had typed them in.

    const char *test = "Next" SYMBOL_STR(78) " one";
    /* same as
       const char *test = "Next\x78 one";
    */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a parent that defines a onmouseup event that hide/display a table.
I have a table that is something like this: ╔════════════╗ ║ table_test ║ ╠════════════╣
I have a subclass of javax.swing.table.AbstractTableModel that defines table column headers like this: protected
I have a MySQL table that defines values for a specific customer type. |
I have 3 tables, - Section table that defines some general item sections. -
I have a table that defines the possible categories in my website - fields
I have a table that defines the rule between two variants: CREATE TABLE VARIANTCOMBINATIONRULE
I have an intermediate table that defines many-to-many relationship between, for instance, Customer and
I have a database table that is a dictionary of defined terms -- key,
I have a database table that has a Unique Key constraint defined to avoid

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.