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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:54:30+00:00 2026-06-08T16:54:30+00:00

Out of interest: #define _ACD 5, 5, 5, 30 #define DEFAULT_NETWORK_TOKEN_KEY_CLASS _ACD #define DEFAULT_NETWORK_TOKEN_KEY

  • 0

Out of interest:

#define _ACD 5, 5, 5, 30

#define DEFAULT_NETWORK_TOKEN_KEY_CLASS   _ACD 

#define DEFAULT_NETWORK_TOKEN_KEY { DEFAULT_NETWORK_TOKEN_KEY_CLASS }

Using DEFAULT_NETWORK_TOKEN_KEY_CLASS macro only, how to get _ACD stringified in a const unsigned char [].

const uint8 startMsg[] = ?? DEFAULT_NETWORK_TOKEN_KEY_CLASS ;

Will result _ACD only.

What will be the correct macro expansion for getting _ACD here.
In context of How to stringify macro having array as #define a_macro {5,7,7,97}?

  • 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-08T16:54:31+00:00Added an answer on June 8, 2026 at 4:54 pm

    (The standard disclaimer about not abusing the C preprocessor without a really good reason applies here.)

    It’s certainly possible to do what you want to do. You need a STRINGIFY macro and a bit of macro indirection.

    Typically, STRINGIFY is defined with one level of indirection, to allow the C preprocessor to expand its arguments before they undergo stringification. One implementation is:

    /* The # operator converts symbol 'v' into a string */
    #define STRINGIFY0(v) #v
    #define STRINGIFY(v) STRINGIFY0(v)
    

    However, you’ll find that this isn’t enough:

    #define _ACD 5, 5, 5, 30
    #define DEFAULT_NETWORK_TOKEN_KEY_CLASS   _ACD 
    #define DEFAULT_NETWORK_TOKEN_KEY { DEFAULT_NETWORK_TOKEN_KEY_CLASS }
    
    #define START_MSG STRINGIFY(DEFAULT_NETWORK_TOKEN_KEY_CLASS)
    const char startMsg[] = START_MSG;
    

    Here, STRINGIFY(DEFAULT_NETWORK_TOKEN_KEY_CLASS) expands to STRINGIFY0(5,5,5,30), and the C preprocessor complains that you’ve given STRINGIFY0 too many arguments.

    The solution is to delay the expansion of _ACD so it only expands to 5,5,5,30 when you want it to. To do this, define it as a function-like macro:

    #define _ACD() 5, 5, 5, 30
    

    This way, _ACD will only be expanded when you “call” it: _ACD(). DEFAULT_NETWORK_TOKEN_KEY_CLASS will now expand to _ACD, and you have to expand it further by “calling” it: DEFAULT_NETWORK_TOKEN_KEY_CLASS().

    The following code illustrates the solution:

    #include <stdio.h>
    
    #define STRINGIFY0(v) #v
    #define STRINGIFY(v) STRINGIFY0(v)
    
    #define _ACD() 5, 5, 5, 30
    #define DEFAULT_NETWORK_TOKEN_KEY_CLASS   _ACD 
    #define DEFAULT_NETWORK_TOKEN_KEY { DEFAULT_NETWORK_TOKEN_KEY_CLASS() }
    
    #define START_MSG STRINGIFY(DEFAULT_NETWORK_TOKEN_KEY_CLASS)
    
    const char startMsg[] = START_MSG;
    
    int main(int argc, char** argv)
    {
      printf("%s\n",startMsg);
      return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$datef = (date(Y-m-d,mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']))); Out of interest, i'm using this
Just out of interest, it would be nice to know how long my calculation
This question is just out of interest, and perhaps could be useful for my
I'm trying to answer the following question out of personal interest: What is the
Out of interest - Does a default exist or is it different on each
I am just asking this out of interest, I did a Google search and
I made this program just out of interest and wanted to make it better.
I have just started to learn Haskell out of interest. I follow learnyouahaskell.com .
#!/bin/bash # Command line look up using Google's define feature - command line dictionary
Out of interest, how are method names stored in memory in compiled Objective-C? The

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.