// In this example, none of the methods are inline. // (We don’t really say “outline”.) // Usually, the class declaration (interface) would be in Random.h, // and the actual methods (implementation) would be in Random.cc. #include class Random { public: Random(int seed); int value(); private: int state; }; Random::Random(int seed) { state = seed; } // A truly awful random number generator int Random::value() { state = state * 1234567891 + 9708675309; return (state & 0x7fffffff) % 100; } int main() { Random r(1234); for (int i=0; i<20; i++) std::cout << r.value() << ' '; }