Sign in to follow this  
  • entries
    15
  • comments
    13
  • views
    11876

Redirect standard output

Sign in to follow this  
TheGilb

188 views

I got working on my resource management system today. I've made some pretty good progress too but that's not really interesting is it? To be honest that's just donkey work.

Something slightly more interesting I got to work today was redirecting the C++ standard streams cout and cerr to my console window. The console window is rendered in-game using a heavily customised Cegui. Not too shabby eh? It's fast and simple, I think the whole thing is only in the region of 12 - 14 lines of code.

It's funny actually how little the majority programmers seem to know about stl. I don't claim to know everything about stl, but I'm confident enough with templates and the stl syntax to step through the library a bit and figure out what's going on. I have some rather beefy reference books at my disposal too. But I think a lot of programmers just think of the stl as a 'black box' that just always works. I was pleasantly surprised today to work out how to do this and how simple and clean the solution was.

The moral of todays blog entry? Learn your stl, learn it well!
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now