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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:19:32+00:00 2026-06-09T16:19:32+00:00

#define STR_A abc #if STR_A == abc //I want to make some check here

  • 0
#define STR_A  abc
#if STR_A == abc   //I want to make some check here
    do something A
#else
    do something B
#endif

Can I check what the STR_A defined?

  • 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-09T16:19:34+00:00Added an answer on June 9, 2026 at 4:19 pm

    If you want to check if STR_A is defined to the token abc (which by itself shouldn’t be another macro) you can help yourself with some tricks

    #define STR_A_TESTER_abc 1
    #define CONCAT(A, B) A ## B
    #define STR_A_TESTER CONCAT(STR_A_TESTER_, STR_A)
    
    #if STR_A_TESTER
    // do whatever
    #else
    // or other
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have some macro #define NAME name , and I want to define
I've been attempting to make a folder for each architecture my code can support.
I want to define a function: def convert(x: Option[String]): Option[String] = ... When x
In python, I defined a class 'number'. Now I wish to define a function
i have problem with awk,i want to define a string variable (str) depending on
If I define a method with a single argument with a default value, can
I want to define a new class that inherit the build in str type,
I have a 256-bit value in Verilog: reg [255:0] val; I want to define
Here's a program that illustrates my problem: #include <stdio.h> #define NUMERATOR 8 #define DENOMINATOR
I have a config file with some information, in the following format: define(FTP_USERNAME,583hdsljf); define(FTP_PASSWORD,******);

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.