TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRISTIAN S. PEDERSEN
from: FRANK ADAM
date: 1997-07-30 02:57:00
subject: Conversion of pointer.

On Jul 24 20:49, 1997, Christian S. Pedersen of 2:235/209.27 wrote:
G'day Christian,
CSP> int* test()
CSP>     int i=5;
CSP>     return &i;
CSP> Why do I get a "Suspicious pointer conversion"-warning ? The 
CSP> functions using this concept seems to work OK. Should I make them 
CSP> differently.
You'll find those which do work reliably, would have "i" or the whole 
function declared as static.
int* test()
{
 static int i = 5;
 return &i;
}
 Regards, Frank
--- Msged 4.00
---------------
* Origin: The ticking point, Melbourne, Australia. (3:635/728.21)

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™.