CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013

    Shortcut for Commenting out a large block of code

    Is there a quick shortcut (like CTRL+something) to comment out/ decomment a large block of code in Dev C++ when it is selected?

    I find it tedious to go line by line and add the // in front of each line.

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: Shortcut for Commenting out a large block of code

    Yeah - use the /*...*/ way of commenting. Everything between /* and */ is commented out. Note that this way of commenting is not recursive so /*../*..*/..*/ cannot be used - but it can include //comments

    /*These are various lines of code
    I want to comment out
    It is tedious to keep using //
    so I use the other way instead*/

  3. #3
    Join Date
    Feb 2013

    Re: Shortcut for Commenting out a large block of code


  4. #4
    Join Date
    Oct 2006

    Re: Shortcut for Commenting out a large block of code

    Change to a newer environment. Dev C++ hasn't been maintained for a long time. In the free MSVC Express for instance you just mark the area and press Ctrl+K,C to comment and Ctrl+K,U to uncomment. I bet other modern environments has something similar.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here

    Get your free MS compiler here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.