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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:24:28+00:00 2026-06-05T15:24:28+00:00

When using a statement like #if TRUE , what should I expect to happen?

  • 0

When using a statement like #if TRUE, what should I expect to happen? An explanation would be very appreciated! I understand how #if 1 works, but it gives a completely different result in my code than using #if TRUE. I understand #if is a conditional directive, and what that implies; it’s just the TRUE (or FALSE) part that I don’t understand. It seems as though using it in this way never executes code following the statement. Here is an example:

#if TRUE
     cout << "true" << endl;
#endif

#if FALSE
     cout << "false" << endl;
#endif

I never seem to see "true" or "false" printed to screen and using Visual Studio, the inner statement is automatically grayed out.

  • 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-05T15:24:29+00:00Added an answer on June 5, 2026 at 3:24 pm

    The preprocessor will include/exclude the contents of an #if #endif block depending on wether the expression after #if evaluates to true or false.

    #if TRUE will only evaluate to true if

    • the macro TRUE is defined
    • the value of TRUE != 0

    In your example neither TRUE nor FALSE are defined so both blocks are false and excluded.

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

Sidebar

Related Questions

I have a using statement defined like this in codebehind: using Name = Extremely.Long.And.Unwieldy.Namespace
I am using a simple try-with-resources statement like the following: try (final CSVWriter w
I am using to write a select query and the value for like statement
I'm using iBATIS to create select statements. Now I would like to implement the
The using(...) statement is syntactic sugar for try{} finally {}. But if I then
when using ehcache rather than defining statement like <cache name=testonly.package.model.TestPOJOcategory maxElementsInMemory=200 eternal=true overflowToDisk=false timeToIdleSeconds=300
I would like to send and receive bytes over serial. My receiver should get
I am using Ruby on Rails 3 and I would like to inizialize an
This might seem like a very simple question, but I am struggling with it.
I am interested in learning python but my Linux skills suck. I would like

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.