Append a specified number of characters to a character array.
Compatibility:This function is compatible with the following targets:
|
|
#include <string.h>
char *strncat(char *dest,  
const char *source, size_t n);
Parameters for this facility are:
If a null character is reached in source before n characters have been appended, strncat() stops.
When done, strncat() terminates dest with a null character ('\0').
strncat() returns the value of dest.
#include <string.h>
#include <stdio.h>
int main(void)
{
static char s1[100] = "abcdefghijklmnopqrstuv";
static char s2[] = "wxyz0123456789";
strncat(s1, s2, 4);
puts(s1);
return 0;
}
Output:
abcdefghijklmnopqrstuvwxyz
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000