Code cleanup: Difference between revisions

Jump to navigation Jump to search
(throw out obsolete stuff)
Line 18: Line 18:


=== Carelessness ===
=== Carelessness ===
* Properly allocate and deallocate memory using malloc/new/new[{][}] and free/delete/delete[{][}].
* Properly allocate and deallocate memory using malloc/new/new[{][}] and free/delete/delete[{][}]. Valgrind is helpful when looking for these.


Valgrind is helpful when looking for these.
* Close any open file streams when you're through with them. Take care to not write to or close streams that aren't open. Avoid this by initializing file pointers/handles with 0 before use and verify that it is not 0 before writing/closing.


=== Compatibility ===
=== Compatibility ===
186

edits

Navigation menu