_inp、_inpw、_inpd_inp, _inpw, _inpd

从某个端口输入一个字节 (_inp)、一个字 (_inpw) 或一个双字 (_inpd)。Inputs, from a port, a byte (_inp), a word (_inpw), or a double word (_inpd).


这些函数已过时。These functions are obsolete. 从 Visual Studio 2015 开始,CRT 中不再提供这些函数。Beginning in Visual Studio 2015, they are not available in the CRT.


此 API 不能用于在 Windows 运行时中执行的应用程序。This API cannot be used in applications that execute in the Windows Runtime. 有关详细信息,请参阅通用 Windows 平台应用中不支持的 CRT 函数For more information, see CRT functions not supported in Universal Windows Platform apps.


int _inp(
   unsigned short port
unsigned short _inpw(
   unsigned short port
unsigned long _inpd(
   unsigned short port


I/O 端口号。I/O port number.

返回值Return Value

这些函数返回从 port中读取的字节、字或双字。The functions return the byte, word, or double word read from port. 无错误返回。There is no error return.


_inp_inpw_inpd 函数分别从指定的输入端口读取一个字节、一个字和一个双字。The _inp, _inpw, and _inpd functions read a byte, a word, and a double word, respectively, from the specified input port. 输入值可以是 0 - 65,535 范围内的任何无符号短整数。The input value can be any unsigned short integer in the range 0 - 65,535.

由于这些函数可直接从 I/O 端口读取数据,因此无法用于用户代码。Because these functions read directly from an I/O port, they cannot be used in user code.


例程所返回的值Routine 必需的标头Required header
_inp <conio.h><conio.h>
_inpw <conio.h><conio.h>
_inpd <conio.h><conio.h>

有关更多兼容性信息,请参阅 兼容性For more compatibility information, see Compatibility.


C 运行时库的所有版本。All versions of the C run-time libraries.

请参阅See also

控制台和端口 I/OConsole and Port I/O
_outp、_outpw、_outpd_outp, _outpw, _outpd