Exemplo n.º 1
0
int main(void)
{
    int size, sum, product;
    int array[100];
    printf("size = ");
    scanf("%d", &size);
    array_in(array, size);
    sum = sum_arr(array, size);
    product = product_arr(array, min_element(array, size), max_element(array, size));
    printf("sum = %d \n", sum);
    printf("product = %d \n", product);
    return 0;
}
Exemplo n.º 2
0
/*
 * anyarray_in		- input routine for pseudo-type ANYARRAY.
 */
Datum
anyarray_in(PG_FUNCTION_ARGS)
{
#ifdef XCP
	/*
	 * XCP version of array_in() understands prefix describing element type
	 */
	return array_in(fcinfo);
#else
	ereport(ERROR,
			(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
			 errmsg("cannot accept a value of type anyarray")));

	PG_RETURN_VOID();			/* keep compiler quiet */
#endif
}