Simple Question on Correct Usage of memset
Hello to All,
Here is a simple question related to memset. I have seen various methods used when using memset now, I want to know the correct manner. Lets say you have the following code:
I have seen where some have used memset in a manner like sizeof( ptrFoo ) +1. Now which is it? Should one memset the additional element used for the null or not?
ptrFoo = new char [ (strlen( SOME_CHAR_STRING ) + 1 ) ];
memset( ptrFoo, 0, sizeof( ptrFoo ) );