<< Previous | Next >> | |
|
NEAR SYNTAX: char *_n_strncpy( char *dst, char *src, unsigned int n );
FAR SYNTAX: char far * _f_strncpy( char far * dst, char far * src, size_t n );
NOTE By default, strncpy()
is defined to_n_strncpy()
.Description
- Copies a given number of characters from one string to another and padding with null characters or truncating as necessary.
- For Rabbit 4000+ users, this function supports FAR pointers. By default the near version of the function is called. The macro
USE_FAR_STRING
will change all calls to functions in this library to their far versions. The user may also explicitly call the far version with_f_strfunc
wherestrfunc
is the name of the string function.
- Because FAR addresses are larger, the far versions of this function will run slightly slower than the near version. To explicitly call the near version when the
USE_FAR_STRING
macro is defined and all pointers are near pointers, append_n_
to the function name, e.g.,_n_strfunc
. For more information about FAR pointers, see the Dynamic C User's Manual or the samples inSamples/Rabbit4000/FAR/
.Parameters
- dst
- Pointer to location to receive string.
- src
- Pointer to location to supply string.
- n
- Maximum number of bytes to copy. If equal to zero, this function has no effect.
Return value
- Pointer to destination string.
Library
- STRING.LIB
See also
- strcpy
Dynamic C Functions | << Previous | Next >> | rabbit.com |