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

  • Home
  • SEARCH
  • 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 6167837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:34:54+00:00 2026-05-23T22:34:54+00:00

This should be a common problem and possibly similar to some question here but

  • 0

This should be a common problem and possibly similar to some question here but i am looking foe the best way to comment out multiple lines (rather methods ) in C++ which have comments within them .I did check out some posts on SO but couldnt get the full details on using something like if #0 .

I did check out this post Nested comments in Visual C++? but I am not on the Windows platform.

  • 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-23T22:34:55+00:00Added an answer on May 23, 2026 at 10:34 pm

    You are almost correct; essentially it is being suggested to “if-def” the section of code out. What you want to do is use the precompiler directive #if to block the code for you. Ex below shows that I want to ignore everything between the if and endif.

    #if 0
    /* Giant comment
     it doesn't matter what I put here */
    
    // it will be ignored forever.
    #endif
    

    To answer your question in general though; there is not a way to have compound comments, i.e.

    /* 
      /* */ <--- this closes the first /* 
    */ <--- this dangles.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be a common scenario, but could not find any relevant post yet..
This should a quick question for some easy rep. I'm doing some PHP Website
This should be a really really simple thing, but for some reason it is
This should be easy, but I'm not sure how to best go about it.
This should be a simple question, but I haven't been able to find a
I have a feeling this should be a common requirement, but I can't work
This may be a more math focused question, but wanted to ask here because
This should be easy for many of you, but for me it's just another
I'm pulling items from a database (in this case, comments, but it should apply
I posted this question on the Qt forum, but got no answers. That's why

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.