It works for me. Is your file name .c or .cpp . Try to have it as .c file and also remember that some other program compiles correctly and then try to compile the above program so that you know what is the problem.