strncat, _fstrncat
raw OCR
Appends a portion of one string to another.
Defined in header <string.h>
Syntax
#include <string.h>
Near version: char *strncat(char *dest, const char *src, size_t maxlen);
Far version: char far * far _fstrncat(char far *dest, const char far *src,
size_t maxlen)
Portability
| DOS | UNIX | Windows | ANSI C | C++ only | |
|---|---|---|---|---|---|
| Near version | ■ | ■ | ■ | ■ | |
| ■ | ■ |
Remarks
strncat copies at most maxlen characters of src to the end of dest and then
| appends a null character. The maximum | length of the resulting string is |
str\enidest) + maxlen.
Return value
strncat returns dest.
Example
#include <string.h>
#include <stdio.h>
int main(void)
{
char destination[25] ;
char *source = " States";
strcpy (destination, "United");
strncat(destination, source, 7);
printf ("%s\n", destination);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `strncat, fstrncat` read as `strncat, _fstrncat`
Stable link: /3.1/string.h/strncat/
· short form /3.1/strncat/