It looks like you need to use bal instead of gbal. The variable gbal is not declared in main.

Also, your getBalance is going to return exactly what was passed to it. You may want to change this...