i got an class which creates numbers between 1-6 and another class which puts them into an array. How can i compare two arrays if they are the same? (so the commented line would work)
#include <iostream>
#include <ctime>
#include <cstdlib>
class dice {
private:
unsigned int number;
public:
dice() {
(*this).number = (rand() % 6) + 1;
return;
}
};
class dicemng {
private:
unsigned int dice_count;
dice* arr_dice;
public:
dicemng(unsigned int k = 0) : dice_count(k) {
arr_dice = new dice[dice_count];
return;
}
};
int main() {
srand(time(nullptr));
dicemng w1(5), w2(5);
//std::cout << (w1 == w2) << std::endl;
return 0;
}
Thanks for any help!
Aucun commentaire:
Enregistrer un commentaire