Re: my C pgm - Mailing list pgsql-general

From
Subject Re: my C pgm
Date
Msg-id Pine.LNX.4.30.0011232254420.2575-100000@chapelperilous.net
Whole thread Raw
In response to my C pgm  (Lisa Reilman <lr425@stl.rural.usda.gov>)
List pgsql-general
On Thu, 16 Nov 2000, Lisa Reilman wrote:

> This program is suppose to have averagefunc that accepts 5 floating
> point numbers as arguments and return the average to two decimal places.
>
> I keep getting syntax errors on lines 6 & 26 and on line 29 is says
> unspecified a,b,c,d,e.

Not sure what this has to do with PostgreSQL, but this compiled and ran
fairly cleanly for me, after I fixed one simple thing.

> 5  float num1, num2, num3, num4, num4, num5, avg;
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

No need to make these global variables outside of main.  You also declared
num4 twice.

It ran fine for me then.  What C compiler are you using?

Brett W. McCoy
                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
CONGRATULATIONS!  Now should I make thinly veiled comments about
DIGNITY, self-esteem and finding TRUE FUN in your RIGHT VENTRICLE??


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backward Compatibility
Next
From: "Christopher Kings-Lynne"
Date:
Subject: RE: [HACKERS] Enum type emulation: problem with opaque type in PL/pgSQL functions