Class Card Deck

Joined
Jul 3, 2020
Messages
1
Reaction score
0
I'm trying to represent a deck of cards as a class, but when I try to use this it says "this may only be used in a nonstatic member function. I'm new to coding, so this is probably an easy fix.

Here's my code so far:

#include <iostream>
#include<string>
#include <random>
using namespace std;
class carddeck {
public:
string suit;
int number;
bool facecard;
}
carddeck(string suit, int number, bool facecard) {
this->suit = suit;
this->number = number;
this->facecard = facecard;
}

int main()
{

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Range / empty list issues?? 1
Mutability issue 1
TF-IDF 1
Padding strings for a clean visual print out... 5
Crossword 14
Character operations in C++ 2
Cannot find my infinite loop 1
Lexical Analysis on C++ 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top