main부분
--
cin>>userNumber;
User* user = new User[userNumber];
for(int i=0;i<userNumber;i++)
user[i] = User();
Lotto lotto = Lotto();
lotto.Match(user);
----
class User
{
private :
int number[6];
public :
User();
~User();
int* GetNumer();
};
class Lotto
{
private :
int number[6];
int* match;
public :
Lotto();
~Lotto();
void Match(User* user);
};
---
void Match(User* user) 함수가 user의 Number와 Lotto의 Number를 비교하여 유사도를 검사해서 출력하는 함수인데
userNumber를 인자로 받지 않고서도 User포인터 user만으로 개수를 알 수 있음??
댓글 0