You are very familiar with strncpy_s(wszStringBuffer, BUFFER_SIZE, wszSourceBuffer, dwCopyBytes)
But if you declare wszStringBuffer[16], and call
strncpy_s( wszStringBuffer[5], ???, wszSourceBuffer, dwCopyBytes)
What value of the second parameter you should use?
Answer:
Finally, I use (BUFFER_SIZE - 5). I didn't investigate the detail.
Additional information,
you can use _countof() macro instead of BUFFER_SIZE as your 2nd parameter.
However, you can not use pointer in _countof() macro.
The following usages are illegal:
_countof ( pPointerToArray )
_countof ( wszStringBuffer[5] )
----
Frank
No comments:
Post a Comment