| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| 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.
> ] * 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™.