1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" based on glibc infopages
5 .\" aeb, 2003, polished a little
6 .TH mempcpy 3 2003-11-11 "GNU" "Linux Programmer's Manual"
8 mempcpy, wmempcpy \- copy memory area
11 .B #define _GNU_SOURCE
13 .B #include <string.h>
15 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
17 .B #define _GNU_SOURCE
21 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
26 function is nearly identical to the
30 bytes from the object beginning at
32 into the object pointed to by
34 But instead of returning the value of
36 it returns a pointer to the byte following the last written byte.
38 This function is useful in situations where a number of objects
39 shall be copied to consecutive memory positions.
43 function is identical but takes
45 type arguments and copies
49 \fIdest\fP + \fIn\fP .
53 combine(void *o1, size_t s1, void *o2, size_t s2)
55 void *result = malloc(s1 + s2);
57 mempcpy(mempcpy(result, o1, s1), o2, s2);
62 This function is a GNU extension.
68 .BR feature_test_macros (7)