خرید بک لینک

Vote count: 0

How does the below code work??

template <size_t MAX>
array<int,MAX>& operator-(array<int,MAX>& a, array<int,MAX>& b)
{
    array<int, MAX> c;
    int i = 0;
    while (i != MAX)
    {
        c[i] = a[i] - b[i];
        i++;
    }
    retu c;
}

Calling ::

array<int, 6> c = b - a;

I wonder how MAX get its value from the array subscript operator. In that case can we call the functions without giving the size of object in case if it is needed??

asked 54 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 15 خرداد 1395 ساعت: 14:21

صفحه بندی