Category : Files from Magazines
Archive   : WDAUG92.ZIP
Filename : 3N08060A
#include
#include
#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;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/