Introduction to OOP | Chapter 4: Classes and Methods: | next | previous | audio | real | text |
class PlayingCard { public: ... Colors color () ; ... }; PlayingCard::Colors PlayingCard::color ( ) { // return the face color of a playing card if ((suit == Diamond) || (suit == Heart)) return Red; return Black; }Notice need for fully-qualified names.