SW006013 Microchip Technology, SW006013 Datasheet - Page 122

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
DS51456E-page 118
memmove
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
Copies n characters of the source buffer into the destination buffer,
even if the regions overlap.
<string.h>
void *memmove(void *s1, const void *s2, size_t n);
s1
s2
n
Returns a pointer to the destination buffer
If the buffers overlap, the effect is as if the characters are read first from
s2 then written to s1 so the buffer is not corrupted.
#include <string.h> /* for memmove */
#include <stdio.h>
int main(void)
{
}
Output:
buf1 : When time marches on
buf2 : Where is the time?
buf3 : Why?
buf1 after memmove of 6 chars of buf2:
buf1 after memmove of 5 chars of buf3:
char buf1[50] = "When time marches on";
char buf2[50] = "Where is the time?";
char buf3[50] = "Why?";
printf("buf1 : %s\n", buf1);
printf("buf2 : %s\n", buf2);
printf("buf3 : %s\n\n", buf3);
memmove(buf1, buf2, 6);
printf("buf1 after memmove of 6 chars of "
printf("\n");
memmove(buf1, buf3, 5);
printf("buf1 after memmove of 5 chars of "
Where ime marches on
Why?
"buf2: \n\t%s\n", buf1);
"buf3: \n\t%s\n", buf1);
buffer to copy characters to (destination)
buffer to copy characters from (source)
number of characters to copy from s2 to s1
/* for printf
© 2008 Microchip Technology Inc.
*/

Related parts for SW006013