Well, you didn't specify how it didn't work, but on one of my compilers, there's a run-time assertion if the allocation size exceeds a certain limit, and 4294967295 is beyond that limit. Such an assertion throws up a dialog box and aborts the program, which could look like an uncaught exception. You're probably seeing something like that, and because the assertion stops the program before malloc returns, no about of testing the return value will save you.
yaa this is what was happening...i searched net for run time assertion...and found a macro ndebug
and i used it like this
#ifndef NDEBUG const bool ndebug=false; #else const bool ndebug=true; #endif
but still it gives the same dialog box....is there any way to switch it off
and 1 more thing...Is there any limit to no of posts in a thread..because previous thread(new and malloc) was closed after 15 replies