Ask your own question, for FREE!
Computer Science 25 Online
OpenStudy (anonymous):

What if memcpy() is used on overlapping buffers?

OpenStudy (farmdawgnation):

o.O Then, well, eh... bad things happen. heh.

OpenStudy (anonymous):

It depends. If your destination buffer address is smaller than your source buffer address, it'll work fine - *once*. In the opposite case, obviously, the results can be pretty unpredictable as you may lose your source data by overwriting it.

OpenStudy (farmdawgnation):

It may also be worth noting that using memcpy incorrectly can cause some nasty Segmentation Faults. heh.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!