String Parsing - What am I messing up?

Instead of the

if(isdigit(c))
            {
               brightnessVal *= 10;
               brightnessVal += c - '0';
             }

could I just get the next 3 digits after the starting value?