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)
|