The program works great except for passing the Resiststring to the Convertcolor function. The first three band colors are returned as the default (gold). I've looked it over so many times and I can't seem to find the error.
Please excuse any errors in my posting style or etiquette. First time post.
int Resistance::ResistToleranceConvert()
{ string ResistString;
int i(0), C(0), element(0);
ostringstream os;
os << ResistValue;
ResistString = os.str();
while(i < ResistString.length() && element < 3)
{
if (isdigit(ResistString.at(i)))
{
ConvertColor(ResistString.at(i), Band, element);
element++;
}
else if (ResistString.at(i) == '^')
{
if (ResistString.at(i+1) == '-')
{
C = '-' + ResistString.at(i+2);
ConvertColor(C, Band, element);
element++;
}