O'Reilly logo

Joy of Patterns: Using Patterns for Enterprise Development, The by Brandon Goldfedder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

card.cpp

// Card Body
// Brandon Goldfedder

#include "card.h"

char Card::SuitAsChar() const
{
   char retval;
   switch (suit) {
      case HEART: retval = 'H'; break;
      case DIAMOND: retval = 'D'; break;
      case SPADE: retval = 'S'; break;
      case CLUB: retval = 'C'; break;
      default: throw "Illegal Card"; // Can not occur
      }
   return retval;
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required