Two thoughts:
-
That *"\0" in the array initializer looks fishy to me, somehow. When you print out redC, greenC, and blueC, do you get what you expect? If you change *"\0" to just 0, does it change the behavior?
-
You don't need strtol() for a one-byte output value; look into atoi(). Probably not what's causing your problem, though.
-br