*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> stpcpy (3)              
Title
Content
Arch
Section
 

STPCPY(3)

Contents


NAME    [Toc]    [Back]

       stpcpy - copy a string returning a pointer to its end

SYNOPSIS    [Toc]    [Back]

       #include <string.h>

       char *stpcpy(char *dest, const char *src);

DESCRIPTION    [Toc]    [Back]

       The  stpcpy()  function	copies the string pointed to by src (including
       the terminating `\0' character) to the array pointed to by  dest.   The
       strings	may not overlap, and the destination string dest must be large
       enough to receive the copy.

RETURN VALUE    [Toc]    [Back]

       stpcpy() returns a pointer to the end of the string dest (that is,  the
       address of the terminating null character) rather than the beginning.

EXAMPLE    [Toc]    [Back]

       For  example,  this  program  uses stpcpy to concatenate foo and bar to
       produce foobar, which it then prints.

		 #include <string.h>

		 int
		 main (void)
		 {
		   char *to = buffer;
		   to = stpcpy (to, "foo");
		   to = stpcpy (to, "bar");
		   printf ("%s\n", buffer);
		 }

CONFORMING TO    [Toc]    [Back]

       This function is not part of the ANSI or POSIX standards,  and  is  not
       customary  on Unix systems, but is not a GNU invention either.  Perhaps
       it comes from MS-DOS.

SEE ALSO    [Toc]    [Back]

      
      
       strcpy(3), bcopy(3), memccpy(3), memcpy(3), memmove(3)



GNU				  1995-09-03			     STPCPY(3)
[ Back ]
 Similar pages
Name OS Title
stpncpy Linux copy a fixed-size string, returning a pointer to its end
wcpcpy Linux copy a wide character string, returning a pointer to its end
wcpncpy Linux copy a fixed-size string of wide characters, returning a pointer to its end
elf_strptr IRIX make a string pointer
XmStringCopy Tru64 A compound string function that makes a copy of a string
XmStringCopy HP-UX A compound string function that makes a copy of a string
XmStringCopy IRIX A compound string function that makes a copy of a string
strcpy Linux copy a string
memmove FreeBSD copy byte string
bcopy NetBSD copy byte string
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service