Help needed: Output to Parallel port.
I need to output an incrementing number to a parallel port. I'm currently using this code:
#include <stdio.h>
#include <io.h>
int main (int argc, char **argv)
{
unsigned char num;
FILE *par;
par = fopen("0x378", "w");
for (num=0; num!=255; num++)
{
fflush(par);
fwrite(&num, sizeof(num), 1, par);
printf("Outputting: %d\n", num);
}
fclose(par);
return 0;
}
Where the parallel port has the adress 378h.
But all that does is to create a file called 0x378. How do I get the program to open the parallel port of that address? I'm using MS Visual C++ compiler, but I need a C program.
Cheers for any help.