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()
{
}
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()
{
}