MemSet??? Please Assist???

Hello - If the count argument was to many bytes for an array element, say element 0, would the remaining bytes flow to array element 1, and so on? Thank you in advance.

memset( aCharPtrToAnArrayOfUnsignedLongInt, 0, count )
Last edited on
??? "A char pointer to an array of unsigned long int" ?????? Why?????????

If you have an array of unsigned long int, why have a char*? Why not an unsigned long*?

Anyway, for the purpose of memset() that is irrelevant because it simply takes a void* (see http://www.cplusplus.com/reference/clibrary/cstring/memset/ ) so you can use whatever crazy pointer you want.

If count exceeds the number of bytes of the first element of the array, yes, it will alter the bytes of the next element for sure. But note that the behavior is not governed by the pointer type, simply by the amount of bytes that you request to be overwritten.
@webJose, Legacy code port...

Your response is clear and informative, I appreicate it. Thank you for your time.
Topic archived. No new replies allowed.