Article View: comp.std.c++
Article #497Re: Proposed addition to string library: strnew
From: Walter Bright
Date: Mon, 10 Sep 1990 18:22
Date: Mon, 10 Sep 1990 18:22
11 lines
803 bytes
803 bytes
In article <FOX.90Sep7130228@devo.research.att.com> fox@research.att.com (David Fox) writes:
<I propose the following function be added to the standard string.h:
<
<inline char *
<strnew(const char *s)
<{
< return s ? strcpy(new char[strlen(s)+1], s) : 0;
<}
What's the matter with strdup()? It's not ANSI C, but it's in common
usage among MS-DOS and OS/2 compilers.
Technical Details
Message-ID:
<2699@dataio.Data-IO.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pilchuck!dataio!brightReferences:
<FOX.90Sep7130228@devo.research.att.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pilchuck!dataio!bright From: bright@Data-IO.COM (Walter Bright) Newsgroups: comp.std.c++ Subject: Re: Proposed addition to string library: strnew Message-ID: <2699@dataio.Data-IO.COM> Date: 10 Sep 90 18:22:22 GMT References: <FOX.90Sep7130228@devo.research.att.com> Distribution: comp Organization: Data I/O Corporation; Redmond, WA Lines: 11