-
Recent Posts
Recent Comments
Mike T. on Code snippet Using WMI via… Drew Canitz on minimal ATL window eskici on file transfer over synchronous… Rose on Purify reported error entry po… duongnguyenvan on file transfer over synchronous… Archives
- August 2018
- March 2018
- May 2017
- July 2012
- May 2012
- April 2012
- March 2012
- January 2012
- October 2011
- September 2011
- July 2011
- June 2011
- May 2011
- April 2011
- October 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- July 2009
- June 2009
- May 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
Categories
Meta
Monthly Archives: November 2009
why do I use alloca
alloca function allocates memory from stack, thus is much faster than heap and is released automatically when function exit. At first look it like like declare a char array, but the difference is that you can only declare array of … Continue reading
Posted in CPP
2 Comments
std::stack, std::queue and std::priority_queue
The interesting fact is that std::queue and std::priority_queue has different interface – std::queue has front(), but std::priority_queue has top(). #include <stack>#include <list>#include <iostream>#include <string>#include <queue> template<typename ContainerType>void fill_container(ContainerType& cnt){ cnt.push(‘a’); cnt.push(‘0’); cnt.push(‘b’); cnt.push(‘c’);} void main(){ typedef std::stack< char, std::list<char> > … Continue reading
Posted in CPP
Leave a comment
exception in ctor
operator new return NULL if ctor throw exception, this will leads to resource leak, and other possible problem like lock is not released. // ctor.cpp : test throw exception in ctor.// cl -EHsc -d1reportSingleClassLayoutCtorWithException ctor.cpp #define _CRTDBG_MAP_ALLOC#include <tchar.h>#include <stdlib.h>#include <crtdbg.h>#include … Continue reading
Posted in CPP
Leave a comment
boost.program_options crash
A program linking with libboost_program_options-vc90-mt-gd-1_35.lib crashed at desc.add_options(), but the release version worked. At last it turned out to be due to mixed usage of debug version CRT and release version CRT – the program in trouble linked to some … Continue reading
Posted in CPP
Leave a comment