I   have   used  outportn(base,pin); cmd with header file dos.h
and as per my knowledge there are no errors in the program.
BUT ITS NOT WORKING for crazy it worked ones in my friends computer and never worked again ...  What should I do ??Please help me 
I use XP.

All of the comments I've found (with my Google search that you should have made) indicate that application level programs under 32-bit windows (aka Win32) cannot directly access the I/O ports.

The primary suggestion appears to be that if you really need that level of access to the hardware you will need to write a driver to support it. There was also a mention of some sample code included in the Windows DDK.

I have no personal experience in that area, good luck.

> I have used outportn(base,pin); cmd with header file dos.h
Which is older - you or your compiler?

I'm figuring you're using some fossil like TurboC.

The answer is to "get with the times", and use a compiler which is actually compatible with your OS, and not something which is half-heartedly supported for backward compatibility.

This article has been dead for over six months. Start a new discussion instead.