Thread: How does memcpy() work?

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    6

    How does memcpy() work?

    I know when to use it like assigning values between arrays, but how does it work on the inside. If you could show in some more code that would be awesome thanks!

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Google: memcpy code
    [My] First Result: Koders Code Search: memcpy.c - C - GPL

  3. #3
    Registered User
    Join Date
    Aug 2012
    Posts
    6
    Thanks Matticus that helped a lot. I was googling how memcpy() works in C and I got no results

  4. #4
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    It's hard to say how it works on the inside. C libraries can be written in C. There are many references showing standard C libraries written in C but they are for illustrative purposes to aid in understanding, or to provide a portable way to port libraries to different platforms. They do not imply that that's the way things are in practice.
    Most libraries, when the target machine is known, will use highly optimized assembly routines. I wouldn't be surprised if some object code takes advantage of hand-tuned SSE2 / SSE3 architectures which may not be accessible by current optimizing compilers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. when should I use memcpy()?
    By ppdouble in forum C Programming
    Replies: 19
    Last Post: 06-01-2012, 01:52 AM
  2. memcpy
    By sharp_wan in forum C Programming
    Replies: 19
    Last Post: 10-03-2011, 04:16 PM
  3. memcpy
    By m37h0d in forum C++ Programming
    Replies: 28
    Last Post: 04-12-2008, 09:10 PM
  4. memcpy()
    By Moni in forum C++ Programming
    Replies: 3
    Last Post: 09-05-2006, 05:31 AM
  5. memcpy use?
    By jerrykelleyjr in forum C++ Programming
    Replies: 21
    Last Post: 02-17-2005, 07:39 AM

Tags for this Thread