Menu

Trouble with Printing Code and/or Exporting

2008-02-19
2012-09-26
  • blueberrybruise

    blueberrybruise - 2008-02-19

    Hi. I have just completed a programming project for class and I need to print it out. The trouble is is when I print from Bloodshed Dev-C++ 4.9.9.2 my comments get cut off. They are formatted with double slashes to the right of my code. It does have a lot of very verbose comments, since I figure my professor needs a lot of them to catch my train of though. Anyhow, will exporting it and printing the .rtf file "break" my code in any way? I know its just spaces but do I need to insert any extra double slashes to make it clearer which text is comments? I don't want to get marked down for some silly formatting weirdness. Alternately, it would be cool if I could print the code and have the comments flow onto another page that would lay to the right side of my code, like a book format. Anybody have any ideas? Thank you very much for your suggestions.

     
    • cpns

      cpns - 2008-02-20

      It is just a plain ASCII text file; you can open it up in any text editor or word processor for printing. YOu won't get colour syntax highlighting however.

      I generally use 6 point monospaced text for printing (Lucida Console, Courier New, or Consolas for example). It is good for about 132 characters of A4 paper (slightly more on US letter perhaps). Unfortunately Dev-C++ does not support different fonts for print and screen.

      If your lines are longer that that I can assure you that your code is already unreadable! It is more usual (and better) to use block comments rather than line-end comments. Commenting each line is unnecessary except in the case perhaps of commenting variable declarations, members, or enumerations. A block comment preceeds a block of related code, is placed at the same indentation level as the code and describes the fuction of the block - which is generally more coherent. If each statment really needs a comment, your statements are probably too complex.

      If you really must persist in this folly you might consider printing in landscape.

      Alternatively use "hanging" line-end comments:

      <statment>........// comment line 1
      ..................// comment line 2
      ..................// comment line 3

      <next statment>...// comment

      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.