Since Windows XP, the root directory of the system partition cannot be written to without administrator privileges. However, for security reasons, Windows Vista and Windows 7 do not grant administrator permissions by default even if logged on as an administrator unless explicitly elevated to this privilege level, which may require that you click through a UAC prompt. This is because a piece of malicious software can cause much more damage if it runs with administrator permissions than if it runs with limited user permissions.
As a result, even if you are logged in as an administrator, your program cannot write to the root directory of the C: drive as it is not given administrator permissions. To solve this problem, run the program as an administrator by right-clicking on the icon of the program and select Run as adminstrator. Note that this may require that you click through a UAC prompt. Furthermore, this can reduce your security, so do this only if this is truly necessary for a particular application.