How does memcpy() work?

This is a discussion on How does memcpy() work? within the C Programming forums, part of the General Programming Boards category; I know when to use it like assigning values between arrays, but how does it work on the inside. If ...

  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
    2,569
    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,832
    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, 06:39 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21