0

I have writen some code for a HugeInteger class, but my input funtions will not work. It is suppose to check the array for negative numbers or 2 digit numbers. Since I randomize the numbers between 0 and 9 and checked them by not using the input funtion I know my problem has to be in code. I just don't see where.

```
void HugeInteger::input(int a[40])
{
bool bad = false;
for (int i=0; i<40; i++ )
{
if ( a[i] < 0 || a[i] >= 10)
{
cout << "Error! One of the numbers in array is negative or
greater than 10." << endl;
bad = true;
i = 40;
}
}
if ( bad = true )
{
for (int i=0; i<40; i++)
{
a[i]=0;
}
}
}
```

*Edited
by mike_2000_17*: Fixed formatting