Error: expected primary-expression before ')' token

I am not sure why I am getting this error?

Private data in this class is Card TheCards[3] and int numCards.

The below function I wrote as a member function.

In the .h
1
2
//post-increment - adds to numCards by one
  Hand operator++( int );


In the .cpp
1
2
3
4
5
6
7
/ Hand Hand::operator++( int )  {
  		Hand temp = *this;
   		setCard(getNumCards(), Card) //this is line 61 in my code
   		(*this)++;
   
   		return temp;   // value return; not a reference return
}


The error it is giving me is;

In member function `Hand Hand::operator++(int)':
61: error: expected primary-expression before ')' token
Last edited on
I think I just figured this out - I need to call setNumCards, not setCard.
Topic archived. No new replies allowed.