The OP's code compiles perfectly well on Microsoft's Visual C++ 2012 compiler.
A C compiler would obviously not compile the code at all.