int getT(int i, int values)
{
int result = 0;
int mask = 0;
i-=1;
if (i < 8)
{
mask = 1*pow(2,i);
result = ((values & mask) > 0);
}
return result;
}
int setTValues (int i1, int i2, int i3, int i4, int i5)
{
return
i1 * pow(2,0) +
i2 * pow(2,1) +
i3 * pow(2,2) +
i4 * pow(2,3) +
i5 * pow(2,4);
}
variable = setTValues (1, 0, 0, 1, 1);
getT(2, variable)
Users browsing this forum: No registered users and 1 guest