Well I remember when I first started learning C++, I was very messy with my code. But these are some things I've learned that help me write better code.
Choose a coding standard and naming convention and stick to it. I know this sounds like a minor thing, but it really does lead to more readable code. When I work on GQE(
https://code.google.com/p/gqe/) I tend to stick with Pascal Case Notation(
http://en.wikipedia.org/wiki/CamelCase). It really doesn't matter what naming convention you use. As long as its readable and constant. This is why I cant even use some of my older projects, I can even figure out my old code. Take a look at at the coding standards for GQE:
https://code.google.com/p/gqe/wiki/CodingStandards. Some things you probably wont have to worry about, like documentation. But its nice to have consistency in your code.
Look around other open source projects. Its good to see how other people do things. Sometimes you might even get the chance to help with a project. That's how I became a contributor to GQE.
Finally one thing i would always do is. If you program any thing Late at night, While Tired, out of it, Etc. Look it over the next day. You might not even remember what it does
. Always good to review your own code (Especially sleepy-coding)
Just my two cents.