agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Mark Costlow <cheeks@swcp.com>
To: aataneja@cs.mtu.edu
Cc: postgres@postgres.Berkeley.EDU
Subject: define FUNCTION ..
Date: Sun, 26 Jun 1994 09:11:39 -0600
Message-ID: <199406261511.JAA18740@swcp.com> (raw)
In-Reply-To: <9406260442.AA14339@cs.mtu.edu>
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.
==============================================================================
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: cheeks@swcp.com, aataneja@cs.mtu.edu
Subject: Re: define FUNCTION ..
In-Reply-To: <199406261511.JAA18740@swcp.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox