home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////
- // rangeerr.cpp: Here is a sample file showing you how to
- // allocate and set an out-of-range error handler for your
- // arrays.
- // Copyright (c) 1993 Azarona Software. All rights reserved.
- //////////////////////////////////////////////////////////////
- #include <iostream.h>
- #include <process.h>
- #include "range.h"
-
- unsigned (*HandleRangeErr)(unsigned i, unsigned sz) = DefaultRangeErrHandler;
-
- unsigned DefaultRangeErrHandler(unsigned i, unsigned sz)
- {
- cout << "Subscript " << i << " out of range (0, " << (sz-1) << ")\n";
- exit(1);
- return 0; // Not used in this function
- }
-