The memset function declared in memory.h is declared this way...
void* memset(void* dest, int c, size_t count);
and the MSDN example of its use I have shows this for setting the 1st four bytes of a buffer to a '*'...
memset(buffer, '*', 4);
The 2nd parameter confuses me a bit because its typed as an int which is a 32 bit quantity in 32 bit Windows, yet the example above shows a literal char being used. I frequently use this function and that always confuses me. I frequently use it to zero out a buffer, and I do this...
memset(szBuffer, '\0', iSomeCount);
Is that correct?
What about just this...
memset(szBuffer, 0, iSomeCount);
Are these equivalent? Is one form preferable to the other? Is one or the other incorrect?