vendredi 21 avril 2017

No suitable conversion from "karta" to "karta*" exists

So i have a problem that i have no idea how to overcome so i came here to look for a senpai with solution. I have a class karta:

class karta {
private:
    string figura;
    int kolor;
    bool zakryta;

public:
    karta::karta() {}
    karta::karta(const string& fig, const int& kol, bool zak) {
        figura = fig;
        kolor = kol;
        zakryta = zak;
    }
    void wypisz();
    void setStatus(bool b) {
        this->zakryta = b;
    };
    friend void definiuj(karta karty[52]);

And I want to defina an array of class karta in function

void definiuj(karta karty[52]) {

    int odliczenie = 0;
    for (int i = 0; i < 13; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            karta karta(figura[i], kolor[j], false);
            karty[odliczenie] = karta;
            odliczenie++;
        }
    }
}

int main()
{
    karta karty[52];
    definiuj(karty[52]);
    return 0;
}

And I just keep running into an error

No suitable conversion from "karta" to "karta*" exists

So after reading some forums I came here looking for your wisdom

Sorry for bad english and poor coding skill






Comments
0 Comments

0 commentaires:

Enregistrer un commentaire