• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

memory functions

how to use the  functions memcpy,memsetand memmove
in what way these differ from each other
0
prasad2315
Asked:
prasad2315
2 Solutions
 
Brian UtterbackPrinciple Software EngineerCommented:
memcpy copies bytes from one location to another, but the two areas must not overlap.
memmove also copies bytes from one location to another, but the areas may overlap.
memset set the bytes in a location to a given value.
0
 
prasad2315Author Commented:
can you explain with implementatin of memmov and memcpy that how the overlap occurs
0
 
Infinity08Commented:
Take a look at these reference pages :

        memcpy : http://www.cplusplus.com/reference/clibrary/cstring/memcpy.html
        memset : http://www.cplusplus.com/reference/clibrary/cstring/memset.html
        memmove : http://www.cplusplus.com/reference/clibrary/cstring/memmove.html


>> can you explain with implementatin of memmov and memcpy that how the overlap occurs

The destination buffer may (partially) overlap with the originating buffer when using memmove. That is not allowed for memcpy however. When using memcpy, the destination and originating buffers must NOT overlap.
0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now