Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    char *strdup( const char *src );
    char __far *_fstrdup( const char __far *src );

Description:
    The strdup and _fstrdup functions create a duplicate copy of the string
    pointed to by src and returns a pointer to the new copy.  For strdup,
    the memory for the new string is obtained by using the  malloc function
    and can be freed using the  free function.  For _fstrdup, the memory for
    the new string is obtained by using the  _fmalloc function and can be
    freed using the  _ffree function.

    The _fstrdup function is a data model independent form of the strdup
    function that accepts far pointer arguments.  It is most useful in mixed
    memory model applications.

Returns:
    The strdup and _fstrdup functions return the pointer to the new copy of
    the string if successful, otherwise it returns NULL.

See Also:
    free Functions, malloc Functions, strcpy, _fstrcpy, strncpy, _fstrncpy

Example:
    #include <stdio.h>
    #include <string.h>

    void main()
      {
        char *dup;

        dup = strdup( "Make a copy" );
        printf( "%s\n", dup );
      }

Classification:
    WATCOM

Systems:
     strdup - All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson