Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>strcat() append a string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 strcat()                Append a String

 #include   <string.h>                   Required for declarations only

 char       *strcat(string1,string2);
 char       *string1;                    Destination string
 const char *string2;                    Source string

    strcat() appends 'string2' to the end of 'string1'.  'string1' is
    terminated with a null character ('\0').  'string1' has to be large
    enough to accommodate 'string2'.

    Returns:    A pointer to 'string1'.

      Notes:    strcat() expects to operate on null-terminated strings.
                There is no overflow checking when strings are copied or
                appended.

   -------------------------------- Example ---------------------------------

    This example appends the string 'Monday.' to the string 'Today is ',
    producing the string 'Today is Monday.'.

           #include <string.h>
           #include <stdio.h>        /* for printf */

           char str1[25] = "Today is ";
           char str2[25] = "Monday.";

           main()
           {
                 strcat(str1,str2);
                 printf(str1);
           }


See Also: strncat()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson