SW006013 Microchip Technology, SW006013 Datasheet - Page 123

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
© 2008 Microchip Technology Inc.
memset
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
Copies the specified character into the destination buffer.
<string.h>
void *memset(void *s, int c, size_t n);
s
c
n
Returns the buffer with characters written to it.
The character c is written to the buffer n times.
#include <string.h> /* for memset */
#include <stdio.h>
int main(void)
{
}
Output:
memset("What time is it?", '?',4);
buf1 after memset: ???? time is it?
memset("", 'y',10);
buf2 after memset: yyyyyyyyyy
char buf1[20] = "What time is it?";
char buf2[20] = "";
char ch1 = '?', ch2 = 'y';
char *ptr;
int res;
printf("memset(\"%s\", \'%c\',4);\n", buf1, ch1);
memset(buf1, ch1, 4);
printf("buf1 after memset: %s\n", buf1);
printf("\n");
printf("memset(\"%s\", \'%c\',10);\n", buf2, ch2);
memset(buf2, ch2, 10);
printf("buf2 after memset: %s\n", buf2);
buffer
character to put in buffer
number of times
/* for printf */
DS51456E-page 119

Related parts for SW006013