could not compile as C

I could not compile tga.c as C language.
Because, variable is not declared in head of function.