4 ms·
Just always use memcpy, you should always know the size of your buffers and if you don’t you will get a buffer overflow at some point.
by david2ndaccount 4y ago
Just always use memcpy, you should always know the size of your buffers and if you don’t you will get a buffer overflow at some point.
- klodolph 4y agoI've heard this advice before, and the problem with this advice is that people who just use memcpy in practice often write code with bugs in it. So the advice is bad advice. Good advice will result in code that has fewer bugs, or bugs with lower severity.
- kevin_thibedeau 4y agoIt can also lead to accidentally quadratic behavior which is why the modernized string ops that get so much hate these days rely on one iteration over the input.