I have a website that I'd like to post my C++ endeavours to. I want to make it so the source code can be viewed on my website with the correct colour coding, etc.
I'm relatively new to CSS and XHTML. I've been using Notepad++.
How do I go about doing this?
The most basic solution is to wrap the code in pre tags to preserve the formatting. But be careful with C++, because you'll need to remember to escape certain characters like angle brackets and the & operators, otherwise they'll be stripped when the browser can't interpret them as HTML. It's annoying looking at naively posted code and seeing #include with the actual header missing. ;)
You could also wrap the code in HTML code tags. I'm not sure off the top of my head if that will fix the stripping problem or not though, it's something to test.