Laxmikant_Yadav is right, modern Windows versions do not allow you to write directly to hardware. If you were to run your program on a Windows 9x or MS-DOS machine it wouldn't give you a violation error.
To write to the parallel port using the Windows API, so it works with modern Windows versions as well, you could write something like this:
#include <windows.h>
#include <stdio.h>
void main(void)
{
HANDLE hPort = CreateFile("LPT1",GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if(hPort != INVALID_HANDLE_VALUE){
char buffer[5] = {'h','e','l','l','o'};
unsigned long count;
if(WriteFile(hPort, buffer, 5, &count, 0))
printf("Write succesful.\n");
else
printf("Write failed\n");
CloseHandle(hPort);
}
else
printf("Unable to access LPT1.");
}