How to return null to a user defined class in c++ -


i have defined queue class works card class have created, function method return supposed return card when called, if there no card should return null. problem keep getting errors when try null, null, , '\0'.

for '\0' char card error, null long card error, strange part null not recognized keyword , ignored.

i wondering if have define null in cards class somehow, or if different issue altogether. here's code using queue class, in case needed:

class queue{     card cards[52];     int first;     int last;     int count;  public:     queue();      void insert(card insert);     card remove();     int getsize(); };  queue::queue(){     first = last = count = 0; }  card queue::remove(){     if(count == 0)         return null;     card temp = cards[last];     last++;     count--;     if (last > 0)         last = 51;     return temp; } 

edit:

class queue{     card *cards; } queue::queue(){     cards = new card[52]; } card queue::remove(){     if(count == 0)         return nullptr; } 


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -