The first line is a declaration, the second line is an assignment.
The compiler only expects declarations at file scope, so you get the "missing type specifier" error for the second line and the other errors follow on from that.
If you really want to set the pointer outside of the functions, do it all on one line:
char *ptr2 = (char*)0xB0110000;