Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id IAA19970 for postgres-redist; Sun, 26 Jun 1994 08:11:24 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199406261511.IAA19970@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from swcp.com ([198.59.115.2]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id IAA19960 for <postgres@nobozo.CS.Berkeley.EDU>; Sun, 26 Jun 1994 08:11:20 -0700
Received: (from cheeks@localhost) by swcp.com (8.6.9/8.6.9) id JAA18740; Sun, 26 Jun 1994 09:11:39 -0600
Date: Sun, 26 Jun 1994 09:11:39 -0600
From: Mark Costlow <cheeks@swcp.com>
Message-Id: <199406261511.JAA18740@swcp.com>
To: aataneja@cs.mtu.edu
CC: postgres@postgres.Berkeley.EDU
In-reply-to: <9406260442.AA14339@cs.mtu.edu> (bbx!mimbres!cs.mtu.edu!aataneja)
Subject: define FUNCTION .. 
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Sun, 26 Jun 94 08:11:23 -0700
Resent-XMts: smtp


On Sun, 26 Jun 1994 00:42:43 -0400 (EDT),
bbx!mimbres!cs.mtu.edu!aataneja (Bruce Taneja.) said:

Bruce> my  test function in circle.c : (compiled ok..)

Bruce> bool  test(t, char1)
Bruce>  TUPLE t;
Bruce>  char *char1;
Bruce> {

Bruce>         BCIRCLE * bca = (BCIRCLE*) GetAttributeByName(t, "a");

Bruce>   return (char1 == "1") ;  /*return +ve if i/p was 1 */
Bruce> }         ^^^^^^^^^^^^
Bruce> -------------

That's a pointer comparison (comparing a parameter to a string constant).
I think what you want to do is compare the data pointed to by those
pointers:

	return(strcmp(char1, "1") == 0);

Or maybe:

	return (*char1 == '1');

>>Chx

--
Mark Costlow
Southwest Cyberport
cheeks@swcp.com

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
