Copy a specified number of characters.
Compatibility:This function is compatible with the following targets:
|
|
#include <string.h>
char *strncpy(char *dest,  
const char *source, size_t n);
Parameters for this facility are:
strncpy() returns the value of dest.
#include <string.h>
#include <stdio.h>
int main(void)
{
char d[50];
static char s[] = "123456789ABCDEFG";
strncpy(d, s, 9);
puts(d);
return 0;
}
Output:
123456789
[ 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