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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:07:41+00:00 2026-05-25T03:07:41+00:00

C supports concatenating constant strings at compile-time. Can I do the same for any

  • 0

C supports concatenating constant strings at compile-time. Can I do the same for any constant array? (E.g. concatenate two char ** arrays.)

  • 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-25T03:07:41+00:00Added an answer on May 25, 2026 at 3:07 am

    Basically no, but you can always workaround this with the preprocessor. The trick is to define arrays without curly braces:

    #define ARRAY_ONE "test1", "test2", "test3"
    #define ARRAY_TWO "testa", "testb", "testc"
    

    Now, you can join arrays in compile time with comma.
    To use them, however, you will either have to sorround them with curly braces or use a macro:

    #define ARR(...) {__VA_ARGS__}
    

    You can now use a single array or any concatenation you need like so:

    char *arr1[] = ARR(ARRAY_ONE);
    char *arr2[] = ARR(ARRAY_TWO);
    char *arrc1[] = ARR(ARRAY_ONE, ARRAY_TWO);
    char *arrc2[] = ARR(ARRAY_ONE, ARRAY_TWO, ARRAY_ONE, ARRAY_ONE);
    

    Using macros to achieve such results is bad practice, though.

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

Sidebar

Related Questions

Pyramid supports an ApplicationCreated event. However I can't find any ApplicationDestroyed / ApplicationShutdown event.
Asciidoc supports callouts . How can one write similar callouts using reStructuredText ?
GCC supports declaring methods with the attribute warn_unused_result so that any caller who does
MySQL supports events where i can set up something to happen in a specified
Configgy supports lists of strings as values and blocks of key/value pairs. But it
GCC supports -fshort-wchar that switches wchar_t from 4, to two bytes. What is the
.NET supports the FlagsAttribute for enum's, which indicates that an enumeration can be treated
I found out that Java supports constant folding of primitive types , but what
NUnit supports a feature where you can specify a set of data inputs for
DKIM supports two canonicalization schemes: relaxed and simple. The former is more lenient and

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.