Datasheet
strncat
strncpy
strspn
Strncmp
557
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
char *strncat(char *to, char *from, int size);
Description
Function appends not more than size characters from the string from to to. The
initial character of from overwrites the null character at the end of to. The termi-
nating null character is always appended to the result. The function returns
to.
Prototype
char *strncpy(char *to, char *from, int size);
Description
Function copies not more than size characters from string from to to. If copy-
ing takes place between objects that overlap, the behavior is undefined. If from
is shorter than size characters, then to will be padded out with null characters
to make up the difference. The function returns the resulting string to.
Prototype
int strspn(char *str1, char *str2);
Description
Function returns the length of the maximum initial segment of str1 which con-
sists entirely of characters from str2. The terminating null character at the end
of the string is not compared.
Prototype
int strncmp(char *s1, char *s2, char len);
Description
Function lexicographically compares not more than len characters (characters
that follow the null character are not compared) from the string pointed by s1 to
the string pointed by s2. The function returns a value indicating the s1 and s2
relationship:
Value Meaning
< 0 s1 "less than" s2
= 0 s1 "equal to" s2
> 0 s1 "greater than" s2