Menu

AUTOINDENTING DEV C++ Compiler

Joe
2009-02-28
2012-09-26
  • Joe

    Joe - 2009-02-28

    Hello-

    This is a newbee level question....

    Using DEV C++, is there a way I can simply select a block of code and indent all lines that are selected by a specified level?

    Or

    Is auto indenting supposed to handle adding indention to code which is nested in "automatically" ?

    Thanks
    J

     
    • cpns

      cpns - 2009-02-28

      To the first question, yes: Ctrl+I (Ctrl+U or outdent). You will have found this facility I believe on the Edit menu together with the associated keyboard shortcut.

      The above is from memory, I no longer bother to install Dev-C++ since there are now better alternatives (with better formatting features).

      With respect to the second question, I have no idea what you mean. Generally (as I recall) it simply maintains the indentation level set by the user on the provious line, and aligns the closing } if it is entered on a line of its own. I suggest that it is 'supposed' to do whatever you observe it doing. I do recommend however not enabling 'smart indent'; that does not seem to do anything 'smart' and it fails me exactly what it's algorithm is.

      Regarding your title, compilers do not do indentation, they just parse the code as you typed it (or your code editor formatted it). Dev-C++ is not the compiler, it is an IDE, the text/code editor component of the IDE is responsible for text formatting.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.