I am having difficulty figuring out how to overload the postfix increment operator for an nested enumerated type of class Card. Moreover, I am also having difficulty getting copy assignment to work for this class. I am getting the following errors "operator++ must take one or zero arguments." Then, when I attempt to provide assignment I get
no match for operator= in ((deck*)->this)->Deck::deckArr = operator new 
class Card {
  public:
    enum Suit {
      SPADES,
      HEARTS,
      CLUBS,
      DIAMONDS
    };
    enum Spot {
      DEUCE,
      THREE,
      FOUR,
      FIVE,
      SIX,
      SEVEN,
      EIGHT,
      NINE,
      TEN,
      JACK,
      QUEEN,
      KING,
      ACE
   };
   Card();
   Card(Card&);
   Card(Suit&, Spot&);
   ~Card();
   Suit& operator++(Suit&,int);
   Spot& operator++(Spot&,int);
   Card& operator=(const Card&);
 private:
   Spot _spot;
   Suit _suit;
};
Card::Suit& Card::operator++(Card::Suit &s, int) {Card::Suit oldsuit = s;
                                            s = (Card::Suit)(s+1);
                                            return oldsuit;}
Card::Spot& Card::operator++(Card::Spot &sp, int){Card::Spot oldspot = sp;
                                            sp = (Card::Spot)(sp+1);
                                            return oldspot;}
Card& Card::operator=(const Card &c){_spot = c._spot; _suit = c._suit; return *this;}
#include "card.h"
class Deck {
 public:
    Deck();
    Deck(Deck&);
    ~Deck();
    void createDeck();
    void shuffleDeck(int);
 private:
    static const int DECK_SIZE = 52;
    Card deckArr[DECK_SIZE];
};
void Deck::createDeck(){
    int x = 0;
    for(Card::Suit s = Card::SPADES; s <= Card::HEARTS; s++){
        for(Card::Spot n = Card::DEUCE; n <= Card::ACE; n++, x++){
             deckArr[x] = new Card(s, n);
        }
    }
}
				
                        
There are two ways to overload
operator++,and
You must not pass anything to
operator++, except a dummy parameter (usuallyint) and usually you don't pass back areferencein postfix.See here for some information.