Re:How to Land a Six-Figure Software Developer Job
by neilc on Monday May 04, 2009 @10:42PM
(#593503)
foo() might throw an exception, leaking "p". Stack allocation should probably be used instead of heap allocation here, anyway.
[ Parent
| on HN ]
Thanks for reminding me why I'm never going anywhere near C++ ever again in my life.
Good answer though, I was stumped.
Re:How to Land a Six-Figure Software Developer Job
by aminuit on Tuesday May 05, 2009 @02:08AM
(#593725)
I totally missed it too. People are using this to bash C++ which is probably fair, but it's worth noting that lots of modern C++ folks default to using RAII pointer types (std::auto_ptr, boost::shared_ptr) to guard against these types of errors.