Code:
Fraction arr[10][11];
if (arr[i][i] == 0)
that part of my code doesn't work...after i is initialized. I'm just wondering why.
these are two of my methods in my class Fraction
Code:
void div( Fraction divisor )
{
numerator *= divisor.denominator;
denominator *= divisor.numerator;
}
void mult( Fraction multiplier)
{
numerator /= multiplier.denominator;
denominator /= multiplier.numerator;
}
in the int main of that program,
fraction arr[10][11] and int i, j, and k are initialized.
i've been trying to send arrays to the class to return it as a fraction. but im not sure if im doing this right.
Code:
if (arr[i][i] != 0) // this line returns an error
{
Fraction divisor = arr[i][i];
for (int k=0; k < (N+1); k++)
{
arr[i][k].div(divisor);
}
}
for (int j=0; j<N; j++) // for each row
{
if (j !=i)
{
Fraction multiplier = arr[j][i];
for (int k=0; k<(N+1); k++)
arr[j][k].mult(multiplier) -= arr[i][k].mult(multiplier);
ok i didn't put that much code in this time..i hope someone can help. im not really sure if im getting somewhere with this right now. i've looked everywhere in my book..and i can't find it..but if its in there and i just can't see it..i just sure as hell don't understand it.