home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / string / strdup.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  541 b   |  30 lines

  1. @node strdup, string
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <string.h>
  6.  
  7. char * strdup (const char *source);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. Returns a newly allocated area of memory that contains a duplicate of
  13. the string pointed to by @var{source}.  The memory returned by this
  14. call must be freed by the caller.
  15.  
  16. @subheading Return Value
  17.  
  18. Returns the newly allocated string, or @var{NULL} if there
  19. is no more memory.
  20.  
  21. @subheading Example
  22.  
  23. @example
  24. char *foo()
  25. @{
  26.   return strdup("hello");
  27. @}
  28. @end example
  29.  
  30.