modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / help / strcpy
blob58e911c6305c2dd4a38f1c1198c744aefe8438f0
1 NAME
2     strcpy - copy head or all of a string to head or all of a string
4 SYNOPSIS
5     strcpy(s1, s2)
7 TYPES
8     s1          string
9     s2          string
11     return      string
13 DESCRIPTION
14     Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2).
15     This function replaces the first m characters of s1 by the first
16     m characters of s2, and if m < n1, replaces the next character of
17     s1 by '\0'. The size of s1 and any later characters of s1 are unchanged.
18     s1, with its new value, is returned.
19     Unlike the C Library function with the same name, this function does
20     not require n1 to be greater than or equal to n2, but if this is so,
21     normal printing of the returned value will give the same result as
22     normal printing of s2.
24 EXAMPLE
25     strcpy("", "xyz") == ""
26     strcpy("a", "xyz") == "x"
27     strcpy("ab", "xyz") == "xy"
28     strcpy("abc", "xyz") == "xyz"
29     strcpy("abcd", "xyz") == "xyz\0"
30     strcpy("abcde", "xyz") == "xyz\0e"
31     strcpy("abcdef", "xyz") == "xyz\0ef"
32     strcpy("abc", "") == "\0bc"
34 LIMITS
35     none
37 LINK LIBRARY
38     STRING* stringcpy(STRING *s1, STRING *s2)
40 SEE ALSO
41     strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
42     strprintf, strscan, strscanf, substr
44 ## Copyright (C) 2006  Ernest Bowen
46 ## Calc is open software; you can redistribute it and/or modify it under
47 ## the terms of the version 2.1 of the GNU Lesser General Public License
48 ## as published by the Free Software Foundation.
50 ## Calc is distributed in the hope that it will be useful, but WITHOUT
51 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
52 ## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
53 ## Public License for more details.
55 ## A copy of version 2.1 of the GNU Lesser General Public License is
56 ## distributed with calc under the filename COPYING-LGPL.  You should have
57 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
58 ## 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
60 ## @(#) $Revision: 30.3 $
61 ## @(#) $Id: strcpy,v 30.3 2013/08/11 01:16:03 chongo Exp $
62 ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcpy,v $
64 ## Under source code control:   2006/03/03 03:32:44
65 ## File existed as early as:    2006
67 ## chongo <was here> /\oo/\     http://www.isthe.com/chongo/
68 ## Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/