I'm wondering if its possible to format code so that it looks exactly like the formatted code when posting on this website using the code brackets. I want to have it in a word document and I like the way it is formatted here.
It wouldn't be beneficial in anyway. Most people who spend any time with their IDE individualize it's appearance. If you want an exact replica maybe a mosaic of screenshots would do the trick? That sounds like a lot of work to me though for very little added functionality.
I don't know what you mean. Do you mean you want a program that reads in your source code and formats it for you? If so, try AStyle. It comes with the CodeBlocks IDE. There is also GNU Indent but I don't like it. It's buggy and it has stupid default settings. One time, in my naivety, I ran Indent on my entire Projects folder and it broke a bunch of files. Luckily it makes backups.
I honestly think you should not, never ever ever, use a owrd-processing program to program with.'
That's my opinion, but it's entirely up to you. If you want your code to be automatically indented when you press enter, etc... and color-coded for read-ability, find an IDE (intigrated developement environment) or a text editor that is specifically tailored to programming with (like Sublim Text, or Notepad++, etc...).
I agree because if you don't know what you are doing you may end up saving the file as something other than plain text causing it to not compile. Though, I wonder if he is using a word processing program to turn in code to an instructor and just wants it to be formatted like the above when turning it in.
I have no idea on how to do that but there is this great text editor that is fully customisable, its called sublime 2. I use it, its great.
The this I like most about it is that it gives you an option to save when you click on another window/program. So when I click on Terminal, it saves and I dont have to press ctrl+s.
IWishIKnew I would never use them to program either, I use visual studio and code blocks, but I was just wondering if there was a program already written that would take in source code, that normally cannot just be copied and pasted into word preserving the formatting, and format it, then all you need to do is copy and paste the snippet. I like the way the code is formatted here and using the highlighter I linked.
If you take a look at it and can think of a way to get it working where you paste your code into a textarea and it then automatically formats it and shows underneath that would be awesome. Also, thanks for the links to the other possible solutions!