4 ms·
I would say that the most common errors are because there is no built-in string type (at least in C) and lot of library function expects null terminated strings
by agazso 16y ago
I would say that the most common errors are because there is no built-in string type (at least in C) and lot of library function expects null terminated strings.
And these are hard to get right, because they are very prone to off-by-one errors, and novice programmers tend to write string manipulation routines from scratch, which leads to corruption.
Use libraries (e.g. bstring or std::string in C++) that do that for you, and you won't have problems.
Regarding memleaks: you can leak database handles, file handles and other resources in managed languages. In C/C++ memory is one of the resources you also take care of. In C++ there are also destructors and you can use RAII to handle most of the cases without thinking.