public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* about gcc library
@ 2003-04-08 18:15 Mehdi Khaldi
  2003-04-08 18:57 ` Phil Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Mehdi Khaldi @ 2003-04-08 18:15 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hi,
How to check if a pointer is allocated or not?

I do "if(p == NULL)". This assumes that the developer did "p = NULL;"
But if he didn't do that, how can I know if the pointer is allocated or not?

Example :

Int *p;

If(p == NULL)
	Printf("P = NULL\n");
Else
	Memset(p, 0, sizeof(int));

I'd like to know if the pointer is allocated.

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-08 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 18:15 about gcc library Mehdi Khaldi
2003-04-08 18:57 ` Phil Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).