mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Some folks might think: “you still use RCS”?!? And we will say, hey, at least we switched from SCCS to RCS back in … I think it was around 1994 ... at least we are keeping up! :-) :-) :-) Logs say that SCCS version 18 became RCS version 19 on 1994 March 18. RCS served us well. But now it is time to move on. And so we are switching to git. Calc releases produce a lot of file changes. In the 125 releases of calc since 1996, when I started managing calc releases, there have been 15473 file mods!
65 lines
2.1 KiB
Plaintext
65 lines
2.1 KiB
Plaintext
NAME
|
|
strcpy - copy head or all of a string to head or all of a string
|
|
|
|
SYNOPSIS
|
|
strcpy(s1, s2)
|
|
|
|
TYPES
|
|
s1 string
|
|
s2 string
|
|
|
|
return string
|
|
|
|
DESCRIPTION
|
|
Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2).
|
|
This function replaces the first m characters of s1 by the first
|
|
m characters of s2, and if m < n1, replaces the next character of
|
|
s1 by '\0'. The size of s1 and any later characters of s1 are unchanged.
|
|
s1, with its new value, is returned.
|
|
Unlike the C Library function with the same name, this function does
|
|
not require n1 to be greater than or equal to n2, but if this is so,
|
|
normal printing of the returned value will give the same result as
|
|
normal printing of s2.
|
|
|
|
EXAMPLE
|
|
strcpy("", "xyz") == ""
|
|
strcpy("a", "xyz") == "x"
|
|
strcpy("ab", "xyz") == "xy"
|
|
strcpy("abc", "xyz") == "xyz"
|
|
strcpy("abcd", "xyz") == "xyz\0"
|
|
strcpy("abcde", "xyz") == "xyz\0e"
|
|
strcpy("abcdef", "xyz") == "xyz\0ef"
|
|
strcpy("abc", "") == "\0bc"
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LINK LIBRARY
|
|
STRING* stringcpy(STRING *s1, STRING *s2)
|
|
|
|
SEE ALSO
|
|
strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
|
|
strprintf, strscan, strscanf, substr
|
|
|
|
## Copyright (C) 2006 Ernest Bowen
|
|
##
|
|
## Calc is open software; you can redistribute it and/or modify it under
|
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
|
## as published by the Free Software Foundation.
|
|
##
|
|
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
|
## Public License for more details.
|
|
##
|
|
## A copy of version 2.1 of the GNU Lesser General Public License is
|
|
## distributed with calc under the filename COPYING-LGPL. You should have
|
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
|
##
|
|
## Under source code control: 2006/03/03 03:32:44
|
|
## File existed as early as: 2006
|
|
##
|
|
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
|
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|