| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Conversion of pointer. |
AD> CP> int* test()
AD> CP> {
AD> CP> int i=5;
AD> CP> return &i;
AD> CP> }
try
int* test() {
int* i = new int;
*i = 5;
return i;
}
Anything not allocated by pointer in {}'s isn't going to exsist outside
the braces. Local variables may be pushed on the stack, allocated from
the heap, or used as registers - the "}" gets rid of it nomatter its
form.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350) |
|
| 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™.