Earlier calls to your histogram program may define this, but your code doesn't.  It was undefined when I tried to run it.