-

Changes

Jump to: navigation, search

Functions HI-TECH C STRCAT

1,423 bytes added, 00:02, 1 August 2017
Created page with "<strong>STRCAT, STRCMP, STRCPY, STRLEN et. al.</strong> ==SYNOPSIS== #include <string.h> char * strcat(char * s1, char * s2); int strcmp(char * s1, char * s2); char..."
<strong>STRCAT, STRCMP, STRCPY, STRLEN et. al.</strong>
==SYNOPSIS==

#include <string.h>

char * strcat(char * s1, char * s2);
int strcmp(char * s1, char * s2);
char * strcpy(char * s1, char * s2);
int strlen(char * s);
char * strncat(char * s1, char * s2, size_t n);
int strncmp(char * s1, char * s2, size_t n);
char * strncpy(char * s1, char * s2, size_t n);


==DESCRIPTION==
These functions provide operations on null-terminated
strings. <strong>Strcat</strong>() appends the string s2 to the end of
the string s1. The string at s1 will be null terminated. Needless to say the buffer at s1 must be big
enough. <strong>Strcmp</strong>() compares the two strings and returns a
number greater than 0, 0 or a number less than 0
according to whether s1 is greater than, equal to or
less than s2. The comparision is via the ascii collating order, with the first character the most significant. <strong>Strcpy</strong>() copies s2 into the buffer at s1, null
terminating it. <strong>Strlen</strong>() returns the length of s1, not
including the terminating null. <strong>Strncat</strong>(), <strong>strncmp</strong>()
and <strong>strncpy() will catenate, compare and copy s2 and s1
in the same manner as their similarly named counterparts above, but involving at most n characters. For
<strong>strncpy</strong>(), the resulting string may not be null terminated.

Navigation menu