SW006013 Microchip Technology, SW006013 Datasheet - Page 130

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 126
strlen (Continued)
Example:
strncat
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
#include <string.h> /* for strlen */
#include <stdio.h>
int main(void)
{
}
Output:
str1 : We are here
str2 :
str3 : Why me?
Append a specified number of characters from the source string to the
destination string.
<string.h>
char *strncat(char *s1, const char *s2, size_t n);
s1
s2
n
Returns a pointer to the destination string.
This function appends up to n characters (a null character and charac-
ters that follow it are not appended) from the source string to the end of
the destination string. If a null character is not encountered, then a ter-
minating null character is appended to the result. If the strings overlap,
the behavior is undefined.
#include <string.h> /* for strncat, strlen */
#include <stdio.h>
int main(void)
{
char str1[20] = "We are here";
char str2[20] = "";
char str3[20] = "Why me?";
printf("str1 : %s\n", str1);
printf("\t(string length = %d characters)\n\n",
printf("str2 : %s\n", str2);
printf("\t(string length = %d characters)\n\n",
printf("str3 : %s\n", str3);
printf("\t(string length = %d characters)\n\n\n",
char buf1[50] = "We're here";
char buf2[50] = "Where is the time?";
char buf3[50] = "Why?";
(string length = 11 characters)
(string length = 0 characters)
(string length = 7 characters)
strlen(str1));
strlen(str2));
strlen(str3));
destination string to copy to
source string to copy from
number of characters to append
/* for printf */
/* for printf
© 2008 Microchip Technology Inc.
*/

Related parts for SW006013