home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!pagesat!netsys!agate!dog.ee.lbl.gov!news!marlin!atkins
- From: atkins@nosc.mil (Hugh T. Atkins)
- Newsgroups: comp.lang.c++
- Subject: help with pass-by-reference
- Keywords: c++,reference,pass
- Message-ID: <1993Jan22.231848.3690@nosc.mil>
- Date: 22 Jan 93 23:18:48 GMT
- Distribution: usa
- Organization: Naval Ocean Systems Center, San Diego, CA
- Lines: 23
-
- Here's the setup, I have a class called Card and declare an array as
- follows
-
-
- Card myHand[5]; // this is an array of 5 playing cards
-
- I want to write a function which tests for pairs of cards and I want
- to use pass-by-reference but I can't figure out how to declare the
- function prototype.
-
- I'd like the function to return an int, something like this
-
- int hasPair( const Card& );
-
- then later I would use
-
- if( hasPair( ?????? ) )
- pairs++;
-
- Can anyone help ? I realize this is sketchy and will provide more info
- if needed.
-
- Thanks , Hugh
-