
#include <stdio.h>
#include <string.h>

#include "cf.h"        // from Listing 5
#include "arraycmp.h"  // from Listing 9

#define DIM(a) (sizeof(a) / sizeof(a[0]))

int a[] = {1, 2, 3, 4, -5};
int b[] = {1, 2, 3, 4, 4};

double f[] = {1, 2, 3, 4, 5};
double g[] = {1, 2, 3, 3, 4};

const char *s[] = {"123", "456", "789"};
const char *t[] = {"123", "789", "456"};

#ifdef __BORLANDC__
int arraycmp(const int[], const int[], size_t);
int arraycmp(const double[], const double[], size_t);
typedef const char *str;
int arraycmp(const str[], const str[], size_t);
#endif

int main(void)
    {
    printf("a vs. b = %d\n", arraycmp(a, b, DIM(a)-1));
    printf("a vs. b = %d\n", arraycmp(a, b, DIM(a)));
    printf("f vs. g = %d\n", arraycmp(f, g, DIM(f)));
    printf("s vs. t = %d\n", arraycmp(s, t, DIM(s)));
    return 0;
    }

