Subj : Re: string comparison To : borland.public.cpp.borlandcpp From : waking@idirect.com (Wayne A. King) Date : Mon Nov 24 2003 10:04 pm On Mon, 24 Nov 2003 21:31:00 +0100, maeder@glue.ch (Thomas Maeder [TeamB]) wrote: >> newstring = new char[ sizeof(passedstring + 1 )] ; >> assert( newstring != 0 ) ; > >This test is moot. This new expression will *never* evaluate to 0. If the >allocation request can't be served, the new expression causes an exception >of type std::bad_alloc to be thrown. That depends on the compiler being used. For many/most/all compilers which are topical in this particular newsgroup, there is no std::bad_alloc exception. -- Wayne A. King (ba994@torfree.net, wayne.king@ablelink.org, waking@idirect.com, Wayne_A_King@compuserve.com) .