TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BRIAN WOOD
from: KURT KUZBA
date: 1998-02-03 07:27:00
subject: returning char. after del

BW> char *FuncToGetSomeString( int len )
BW> {
BW>
BW>    char *psz = new char[len];
BW>    strcpy( psz, "Should I Do This???" );
BW>    delete[] psz;
BW>    return psz;
BW> }
   No. You don't own the memory to which psz now points.
   It has been returned to the system.
> ] You cannot enter the Underground without a Tolkien..........
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.