home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 10.ddi / TVSRC.ZIP / NEWSTR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.3 KB  |  33 lines

  1. /*------------------------------------------------------------*/
  2. /* filename -       newstr.cpp                                */
  3. /*                                                            */
  4. /* function(s)                                                */
  5. /*                  newStr member function                    */
  6. /*------------------------------------------------------------*/
  7.                                                               
  8. /*------------------------------------------------------------*/
  9. /*                                                            */
  10. /*    Turbo Vision -  Version 1.0                             */
  11. /*                                                            */
  12. /*                                                            */
  13. /*    Copyright (c) 1991 by Borland International             */
  14. /*    All Rights Reserved.                                    */
  15. /*                                                            */
  16. /*------------------------------------------------------------*/
  17.  
  18.  
  19. #include <tv.h>
  20.  
  21. #if !defined( __STRING_H )
  22. #include <String.h>
  23. #endif  // __STRING_H
  24.  
  25. char *newStr( const char *s )
  26. {
  27.     if( s == 0 )
  28.         return 0;
  29.     char *temp = new char[ strlen(s)+1 ];
  30.     strcpy( temp, s );
  31.     return temp;
  32. }
  33.