I wish to copy content of specific length from one buffer to another from a specific starting point. I checked memcpy() but it takes only the length of content
memcpy()
Simply increase your pointer to your start index.
Example
const unsigned char * src = reinterpret_cast(your source); unsigned char * dest = reinterpret_cast(your dest); memcpy(dest, src + offset, len);
What about using STL collections to avoid memory access errors?