summaryrefslogtreecommitdiff
path: root/reference/C/FUNCTIONS/memcpy.htm
blob: d2dafe8beaa85ea6a9599b771fa1f383378c55ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<title>memcpy function</title>

<head>
<script language="JavaScript">
</script>
</head>

<body bgcolor=#ffffcc>
<hr>
<center>
<h1>memcpy function</h1>
</center>
<hr>
<p>
<b>memcpy</b> copies data between two memory locations. This function will copy the
supplied number of bytes
stored at the location pointed to by 's2' to the location pointed to by 's1'.

<p>
<center>
<table border=2 width="80%" bgcolor="ivory">
<tr><td>
<pre>

     	s1		s2
	|		|
	V		V
        - - - -		---------------	
       | | | | |       | a | b | c | d |
        - - - -		---------------	
	^ ^		|    |
	| |		|    |
	 -|-------------     |
	   ------------------
</pre>
</td></tr>
</table>
</center>
<p>
<hr>

<h2>Prototype</h2>

<center>
<table border=2 width="80%" bgcolor="ivory">
<tr><td>
<pre>
    Library:   string.h

    Prototype: char memcpy(void *s1, void *s2, int num);

    Syntax:
               float data1;
               char  data2[64];
               
               memcpy(data1, data2, sizeof(data2));
</pre>
</td></tr></table></center><p>
<hr>

<h2>Notes</h2>

This is a handy function for moving data between data types

<h2>See also:</h2>

<img src="../../GRAPHICS/whiteball.gif">
<a href="strtok.html>strtok"</a>
<br>

<img src="../../GRAPHICS/whiteball.gif">
<a href="strncpy.html">strncpy</a> 
<br>

<img src="../../GRAPHICS/whiteball.gif">
<a href="strcpy.html">strcpy</a> 
<br>

<img src="../../GRAPHICS/whiteball.gif">
<a href="sprintf.html">sprintf</a> 
<br>

<img src="../../GRAPHICS/man.gif">
<a href="../MAN/strcat.htm"><i>strcat</a>
<br>

<img src="../../GRAPHICS/whiteball.gif">
<a href="../CONCEPT/string.html">strings</a>
<br>

<img src="../../GRAPHICS/whiteball.gif">
<a href="../FUNCTIONS/memcpy.htm">memcpy</a> Copy data from one memory location to another.

<p>

<hr>
<p>
<center>
<table border=2 width="80%" bgcolor="ivory">
<tr align=center>
<td width="25%">
<a href="../cref.html">             Top</a>
</td><td width="25%">
<a href="../master_index.html">     Master Index</a>
</td><td width="25%">
<a href="../SYNTAX/keywords.html">  Keywords</a>
</td><td width="25%">
<a href="funcref.htm">              Functions</a>
</td>
</tr>
</table>
</center>
<p>
<hr>
<address>Martin Leslie 
</address><p>
</body>
</html>