class randgen
{
protected:
// Seem from system time
staticunsignedlong TimeSeed()
{
return (unsignedlong)time(NULL); /// This looks utterly wrong, and doesn't seem to conform to how "time" works
}
public:
// Constructor
randgen(
unsignedlong initSeed = TimeSeed()
);
// Set seed value
void SetSeed(
unsignedlong newSeed = TimeSeed()
);
// Get a psuedo-random number from 0 to (lim -1)
unsignedshortoperator ()
(
unsignedshort lim
);
~randgen(void);
};
If it's an old book, don't use it. I'm not sure what standard it's based on, but some things don't look right. Take the constructor definitions, for example: The definitions lack the parentheses, and therefore, lack the parameters. Without the parameters, the compiler will not be able to decide which constructor you're defining.