This is meant to be a C and not a C++ program. I am using GCC. But stdio.h is C library, not C++, wonder how you compiled it under G++.