::> Behold, a function which returns a pointer:
The function has a problem though; the variable scope is local to the
function,
and whose contents are only "valid" until the function returns. After that,
the memory location may be used for something else... One solution would be
o
make the variable static.
::> int* test()
::> {
::> int i=5;
::> return &i;
::> }
::> Why do I get a "Suspicious pointer conversion"-warning ? The functions
si
::> this concept seems to work OK. Should I make them differently.
Try parenthesis.
int *test(void)
{
static int = 5;
return (&i);
}
# Herbert Bushong harchon@centuryinter.net [TEAM OS/2]
- Blackbeard's BBS Intelec: 239:600/0
+ Fido: 1:19/19 http://www.intelec.com/software/
---
RM 1.31 2508 Friday the 13th Part LCMXXIV : Jason Meets Spock
---------------
* Origin: Blackbeard's BBS - Ville Platte, LA - 318-468-3385 (1:19/19)
|