Getting error message at compile.
helpers.c:17:18: error: non-object type 'int (string)' (aka 'int (char *)') is not assignable duration = numerator;
My code is as follows:
int duration(string fraction)
{
int numerator;
int denominator;
numerator = atoi fraction[0];
denominator = atoi fraction [2];
if (denominator == 8)
{
duration = numerator;
}
else if (denominator !== 8)
{
duration = (numerator * (8 / denominator));
}
}
If duration is defined as an int and numerator is defined as an int, why am I getting the error? There are more errors but they cascade from this (I think).