I don't know if this is what your after: http://www.experts-exchange.com/Programming/Languages/CPP/Q_10319877.html...