 | C251 User's Guide |  |
|
|
| hstrncpy| Summary |
#include <string.h>
char *xstrncpy (
char huge *dst, /* destination string */
const char huge *src, /* source string */
unsigned long len); /* max characters to copy */
| | Description | The hstrncpy function copies at most len characters from src to dst. Characters are copied until a null character ('\0') is copied or until len characters have been copied. If the length of src is less than len the remaining bytes in dst are padded with null characters ('\0'). Note - This function uses huge pointers to objects.
| | Return Value | The hstrncpy function returns dst. | | See Also | strncpy | | Example |
#include <string.h>
#include <stdio.h> /* for printf */
void tst_strncpy (char huge *s) {
char buf [21];
hstrncpy (buf, s, sizeof (buf));
buf [sizeof (buf)-1] = '\0';
}
|
|
|