Error:Unhandled exception while compiling the program

Jawab Error:Unhandled exception while compiling the program

  • 13 Maret 2012 11:35
     
     

    hi,

    here in this below simple program am trying to compile and which giving an unhandled exception.want to know whether the _outp(),_inp() functions will work for windowsxp operating system.If so,then why am getting the unhandled exception.I would like to check the low and high on the particular pins of parallel port from C program.could u please give me an example to do this way of interfacing with the parallel port in C.

    include "stdafx.h"
    #define PORT1 0x378

    int _inp(unsigned short port);
    int _outp( unsigned short port, int databyte );

    int main () {


     int val = 0;
     short result;

     while ( val < 256) {

       printf("Enter a value in decimal (256 to quit)>");
       scanf("%d", &val);
     

       //_outp(PORT1, val);
       result=_inp(PORT1);
       printf("the result value:%d",result);
     
     }

     _outp(PORT1, 0);


    return 0;
    }

     

    I checked the outportb(); function which doesnot allow at all.compiler am using is visual studio 2008.kindly suggest any tutorial links to learn the complete parallel port interfacing in C or C++

     

Semua Balasan