From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17509 invoked by alias); 8 Apr 2003 16:29:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 17502 invoked from network); 8 Apr 2003 16:29:25 -0000 Received: from unknown (HELO tomts14-srv.bellnexxia.net) (209.226.175.35) by sources.redhat.com with SMTP; 8 Apr 2003 16:29:25 -0000 Received: from softaddictsrv01.intsoftaddicts.com ([65.94.178.101]) by tomts14-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20030408162923.MEDY2534.tomts14-srv.bellnexxia.net@softaddictsrv01.intsoftaddicts.com> for ; Tue, 8 Apr 2003 12:29:23 -0400 Received: by softaddictsrv01.intsoftaddicts.com with Internet Mail Service (5.5.2653.19) id ; Tue, 8 Apr 2003 12:29:23 -0400 Message-ID: <719596FEB24CD6119DDE00508B8B831D5E72@softaddictsrv01.intsoftaddicts.com> From: Mehdi Khaldi To: "'gcc@gcc.gnu.org'" Subject: about gcc library Date: Tue, 08 Apr 2003 18:15:00 -0000 MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2003-04/txt/msg00321.txt.bz2 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