Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > BOOK: Beginning Visual C# 2005
|
BOOK: Beginning Visual C# 2005
This is the forum to discuss the Wrox book Beginning Visual C# 2005 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White; ISBN: 9780764578472
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2008, 03:22 PM
Registered User
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default about chaper 11 operator overloading

Hello!

In the operator overloading > for the card library (page 309 and 310)
Below is a piece of this method that must be wrong
Here it will come if card1 is of the same suit as card2.
But here it check if card1 is of Rank.Ace and if true
it check if card2 is also Rank.Ace.
But hello you can't have two Ace of the same suit.This must be wrong?

if (isAceHigh)
{
   if (card1.rank == Rank.Ace)
   {
     if (card2.rank == Rank.Ace)
       return false;
     else
       return true;
   }
   else
   {
      if (card2.rank == Rank.Ace)
         return false;
      else
         return (card1.rank > card2.rank);
   }
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
Chaper 6 Pivot transformation example?? japak BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 2 March 10th, 2006 12:05 AM
Operator Overloading In Inheritance ahmedsalam C# 0 October 18th, 2005 11:25 AM
operator overloading in VB.NET. rupen General .NET 4 April 21st, 2005 10:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.