About Outp function in conio.h for c or c++?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitppawar2007
    New Member
    • Mar 2008
    • 1

    #1

    About Outp function in conio.h for c or c++?

    #include <stdio.h>
    #include <conio.h>
    int main(void)
    {
    unsigned port = 0;
    int value;
    value = outp(port, 'C');
    printf("Value %c sent to port number %d\n", value, port);
    return 0;
    }

    It gives error
    8 C:\Dev-Cpp\Abc\... `outp' undeclared (first use this function)

    How to solve this ??
    I write function in conio.h but it can't work...
    Any one know correct function to declare outp in conio.h??
    Plz help me to run this program...
    Thanks in advance
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Maybe you should wait for these other folks to answer your question before posting it here.

    http://au.answers.yahoo.com/answers2...5053112AA4kADk.

    Comment

    • questionit
      Contributor
      • Feb 2007
      • 553

      #3
      Originally posted by amitppawar2007
      #include <stdio.h>
      #include <conio.h>
      int main(void)
      {
      unsigned port = 0;
      int value;
      value = outp(port, 'C');
      printf("Value %c sent to port number %d\n", value, port);
      return 0;
      }

      It gives error
      8 C:\Dev-Cpp\Abc\... `outp' undeclared (first use this function)

      How to solve this ??
      I write function in conio.h but it can't work...
      Any one know correct function to declare outp in conio.h??
      Plz help me to run this program...
      Thanks in advance
      Hi

      outp is C's non-standard function. It is not available in some compilers. You might want to try using this function and write your program in some other C compiler.

      Outp function directly accesses I/O ports and this isn't allowed under NT
      and later operating systems. So if you are using Windows NT, XP, etc, you can try these programs in Win32 SDK or similar.


      Regards
      Qi

      Comment

      Working...