Saving the file as cc means gcc will compile it as C++ not C. Save it as .c instead so that gcc will compile it as C instead.