Home Segments Index Top Previous Next

656: Mainline

Note that both the do_analysis function and the railroad_car class contain readily seen newdelete combinations.

Readily seen newdelete combinations is indicative of good programming practice, because you can determine at a glance that memory allocated by a new is eventually reclaimed by a delete. Thus, you can determine at a glance that the new does not cause a memory leak.

The lack of such pairing is considered extremely bad, because it makes memory management much more difficult.