You are trying to initialise the
int
array
AvailableResource
with a single
int
value
AR
. That's not allowed, hence the compiler, correctly, emits an error.
If you really wish to initialize the array with caller supplied values then you should pass an array (or another kind of container) to the
Peers
constructor. Something like
Peers(int ur=0, int dr=0, int ar=0, int chn=0 , int AR[]=nullptr, size_t ARsize=0):
UploadRate(ur), DownloadRate(dr), AnswerRate(ar), CHNumber(chn)
{
if ( AR != nullptr)
{
for (size_t n = 0; n<ARsize && n<30; ++n)
AvailableResource[n] = AR[n];
}
}