7 Segment display dimming
You seem to be trying to do this from scratch. I haven't analysed the code, but you would be better off using one of the established libraries.
The code is unclear - I am not sure what much of it is trying to do (a few comments would help). There are obvious errors - in particular the incorrect use of sizeof()
which is a common error.
I use the following http://playground.arduino.cc/Main/SevenSegmentLibrary
This just requires a single call to set the digits to be displayed and includes a Brightness call.