Hello Brian.
29 Jan 98 23:14, Brian Wood wrote to All:
BW> cout << FuncToGetSomeString(20) << endl;
BW> }
BW> char *FuncToGetSomeString( int len )
BW> {
BW> char *psz = new char[len];
BW> strcpy( psz, "Should I Do This???" );
BW> delete[] psz;
BW> return psz;
BW> }
No. It may work for you, but it's not guaranteed to and is
very poor programming style. De-allocate the array after you
are finished using it.
-Roger
... A big enough hammer can usually fix anything.
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
|