分享方式:


inp、、 _inpinpw_inpw_inpd

輸入,從埠、位元組(、)、單字(inpinpw_inpw)或雙字(_inpd)。 _inp

重要

這些函式已被取代。 自 Visual Studio 2015 起,這些函式即無法在 CRT 中使用。
此 API 無法用於在 Windows 執行階段 中執行的應用程式。 如需詳細資訊,請參閱 CRT functions not supported in Universal Windows Platform apps (通用 Windows 平台應用程式中不支援的 CRT 函式)。

語法

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

參數

port
I/O 連接埠號碼。

傳回值

這些函式會傳回從 port讀取而來的位元組、字組或雙字組。 不會傳回錯誤。

備註

_inp_inpw_inpd 函式會從指定的輸入連接埠讀取位元組、字組及雙字組。 輸入的值可以是 0 - 65535 之間任何不帶正負號的 short 整數。

由於這些函式會直接從 I/O 連接埠讀取,所以無法在使用者程式代碼中使用。

inpinpw 名稱較舊、已被取代的 _inp_inpw 函式名稱。 如需詳細資訊,請參閱 POSIX函式名稱

需求

常式 必要的標頭
_inp <conio.h>
_inpw <conio.h>
_inpd <conio.h>

如需相容性詳細資訊,請參閱相容性

程式庫

所有版本的 C 執行階段程式庫

另請參閱

主控台和連接埠 I/O
outp、、 outpw_outp_outpw_outpd