Yes, that should be fine - well, no memory leaks anyway.
Though later on, you might want to introduce a 'maxsize' as well, so you can re-use the buffer if newsize <= maxsize
Yes, that should be fine - well, no memory leaks anyway.
Though later on, you might want to introduce a 'maxsize' as well, so you can re-use the buffer if newsize <= maxsize
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.