#ifndef _PAIR_H_ #define _PAIR_H_ // The following is the "preferred" way to define constants in // C++, instead of using #define. Unfortunately, MSVC cripples // this approach by treating MAX_PAIR_OCCURRENCES like a variable // instead of a constant. This means you can't do // static const int MAX_SIZE = 10; // int arr[MAX_SIZE]; // Again, you can use #ifdef to avoid this problem, but I've just // used #define for array size constants elsewhere ... static const int MAX_PAIR_OCCURRENCES = 1000000; // A better approach would be to use MAX_INT instead of 1000000, but // unfortunately MAX_INT is defined in different headers for different // systems. We could use #ifdef to check the system type, but it's // not worth the trouble. struct PairKey { char *cd; char *book; }; struct Pair { PairKey key; int numOccurrences; int heapIndex; }; #endif