/************************************************************************ * * * Copyright Digital Equipment Corporation 1998. All rights reserved. * * * * Restricted Rights: Use, duplication, or disclosure by the U.S. * * Government is subject to restrictions as set forth in subparagraph * * (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR * * 52.227-14 Alt. III, as applicable. * * * * This software is proprietary to and embodies the confidential * * technology of Digital Equipment Corporation. Possession, use, or * * copying of this software and media is authorized only pursuant to a * * valid written license from Digital or an authorized sublicensor. * * * ************************************************************************/ /* chap_3_concat.c */ /* This example uses strcat and strncat to concatenate two */ /* strings. */ #include #include main() { static char string1[80] = "Concatenates "; static char string2[] = "two strings "; static char string3[] = "up to a maximum of characters."; static char string4[] = "imum number of characters"; printf("strcat:\t%s\n", strcat(string1, string2)); printf("strncat ( 0):\t%s\n", strncat(string1, string3, 0)); printf("strncat (11):\t%s\n", strncat(string1, string3, 11)); printf("strncat (40):\t%s\n", strncat(string1, string4, 40)); }