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. ## ## @(#) $Revision: 25.2 $ ## @(#) $Id: strcpy,v 25.2 2006/06/25 22:16:55 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcpy,v $ ## ## Under source code control: 2006/03/03 03:32:44 ## File existed as early as: 2006 ## ## chongo /\oo/\ http://www.isthe.com/chongo/ ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/