view docs/ccguide/strcat.refentry @ 3016:eb04ba1c507f

[PATCH 3/3] level2: Include ccbkrn in build again From ec3a9e79eeb1a8bd3b703e4ea9c28ccbb2d641d5 Mon Sep 17 00:00:00 2001 --- level2/coco3/makefile | 24 ++++++++++++------------ level2/coco3/modules/makefile | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-)
author Brett Gordon <beretta42@gmail.com>
date Wed, 29 Oct 2014 23:12:52 +0100
parents 32f33a35f57a
children
line wrap: on
line source

<refentry id="strcat">
<refnamediv>
<refname>Strcat</refname>
<refname>Strncat</refname>
<refname>Strcmp</refname>
<refname>Strncmp</refname>
<refname>Strcpy</refname>
<refname>Strhcpy</refname>
<refname>Strncpy</refname>
<refname>Strlen</refname>
<refname>Index</refname>
<refname>Rindex</refname>
<refpurpose>string functions</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
  <funcdef>char *<function>strcat</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>strncat</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
  <paramdef>int <parameter>n</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>int <function>strcmp</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>strhcpy</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>int <function>strncmp</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
  <paramdef>int <parameter>n</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>strcpy</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>strncpy</function></funcdef>
  <paramdef>char *<parameter>s1</parameter></paramdef>
  <paramdef>char *<parameter>s2</parameter></paramdef>
  <paramdef>int <parameter>n</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>int <function>strlen</function></funcdef>
  <paramdef>char *<parameter>s</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>index</function></funcdef>
  <paramdef>char *<parameter>s</parameter></paramdef>
  <paramdef>char <parameter>ch</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>rindex</function></funcdef>
  <paramdef>char *<parameter>s</parameter></paramdef>
  <paramdef>char<parameter>ch</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
All strings passed to these functions are assumed null-terminated.
</para>
<para>
Strcat appends a copy of the string pointed to by "s2" to the
end of the string pointed to by "s1". Strncat copies at most
"n" characters. Both return the first argument.
</para>
<para>
Strcmp compares strings "s1" and "s2" for lexicographic order
and returns an integer less than, equal to or greater than 0
where, respectively, "s1" is less than, equal to or greater
than "s2". Strncmp compares at most "n" characters.
</para>
<para>
Strcpy copies characters from "s2" to the space pointed to by
"s1" up to and including the null byte. Strncpy copies exactly
"n" characters. If the string "s2" is too short, the "s1" will
be padded with null bytes to make up the difference. If "s2"
is too long, "s1" may not be null-terminated. Both functions
return the first argument.
</para>
<para>
Strhcpy copies string with sign bit terminator.
</para>
<para>
Strlen returns the number of non-null characters in "s".
</para>
<para>
Index returns a pointer to the first occurrence of "ch" in "s"
or NULL if not found.
</para>
<para>
Rindex returns a pointer to the last occurrence of "ch" in "s"
or NULL if not found.
</para>
</refsect1>
<refsect1><title>Caveats</title>
<para>
Strcat and strcpy have no means of checking that the space
provided is large enough. It is the user's responsibility to
ensure that string space does not overflow.
</para>
</refsect1>
<refsect1><title>See Also</title>
<para>
<link linkend="findstr">findstr()</link>.
</para>
</refsect1>
</refentry>