Subj : Re: string comparison To : borland.public.cpp.borlandcpp From : maeder@glue.ch (Thomas Maeder [TeamB]) Date : Tue Nov 25 2003 05:10 am "Base8" writes: > Thanks to all who responded. My thoughts on the assert( newstring != 0 ) ; > are as follows (please correct me > if I have an incorrect understanding) :-). The assert is used during > testing and debugging to verify that memory > is being allocated appropriately for the requested data type. It gets taken > out at compile time with a #define NDEBUG > which causes the assertions to be ignored. Am I incorrect here? It depends. Wayne is right: older compilers, such as most (all?) versions of Borland C++, returned 0 from new expressions if allocation fails. Newer compilers, such as most versions of C++ Builder (and that's what I thought of when I wrote the sentence in question), will throw an exception; on these compilers, the assert() is useless.. So you are perfectly right if you are using an older compiler, which is quite probable since you post here. .