Wednesday, March 17, 2010

C++ note: enabling and disabling assert

In C++, assert is by default compiled. To exclude it, the macro NDEBUG must be defined when assert.h is included. This can be done by using -DNDEBUG compiler option or #define NDEBUG in code.

gcc -DNDEBUG -c test.cpp -o test.o

8 comments:

Anonymous said...

It's great!!..........................................

07_TeddyF_Silvey0 said...

Thank you for Posts~............................................................

Anonymous said...

好的部落格就要和好朋友分享--感謝分享............................................................

Anonymous said...

好的blog值得一推再推,要愈來愈好哦!!!!............................................................

家唐銘 said...

這麼優的部落格,不踩一下不開心............................................................

Anonymous said...

多謝美味的心靈雞湯......................................................

Anonymous said...

好的部落格就要和好朋友分享--感謝分享............................................................

Anonymous said...

人不能像動物一樣活著,而應該追求知識和美德................. ................................................