What\'s the usefulness of the function memset()?.
Definition: Sets the first num bytes of the block of memory pointed by
memset is a common way to set a memory region to 0 regardless of the data type. One can say that memset doesn't care about the data type and just sets all bytes to zero.
IMHO in C++ one should avoid doing memset when possible since it circumvents the type safety that C++ provides, instead one should use constructor or initialization as means of initializing. memset done on a class instance may also destroy something unintentionally:
e.g.
class A
{
public:
shared_ptr _p;
};
a memset on an instance of the above would not do a reference counter decrement properly.