Menu

Accessing parallel port in (Dev-)C++

2002-12-13
2012-09-26
  • Nobody/Anonymous

    Hi,

    I've tried something like:

    #include <stdio.h>

    int main(void)
    {
        unsigned long address;
        unsigned long *paddress;
       
        address=0x00000378;   
        paddress=(unsigned long int  *)address;         
        printf("Data=%Xh\n",*paddress);
       
        return 0;
    }

    But windows gives a illegal operation error in the created executable when I run it. I guess Win doesn't allow acces to this kind of adresses...or am I doing something horibbly wrong here. Please help me out.

    Jasper

     
    • Nobody/Anonymous

      Try this:

      int main(int argc, char *argv[])
      #include <stdio.h>

      int main(void)
      {
        unsigned long address;
        unsigned long *paddress;

        address=0x00000378;
        paddress=&address;
        printf("Data=%Xh\n",*paddress);
        return 0;
      }

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.