You have two separate variables named character: one at file scope set to 'c', whose lifetime is the lifetime of the program, and one in main set to 'b', whose lifetime is that of its scope.
The definition of character in mainmasks the definition at file scope, so only the latter is accessible.