共用方式為


_inp,_inpw _inpd

輸入一個位元組 (_inp),文字 (_inpw),或是 Double Word (_inpd) 從通訊埠。

重要

這個 API 不能用於 Windows 執行階段執行的應用程式。如需詳細資訊,請參閱 CRT 函式不支援使用 /ZW

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

參數

  • port
    I/O 通訊埠編號。

傳回值

函式會傳回位元組、字元組或 Double Word 讀取 port。 不會回傳錯誤。

備註

_inp_inpw_inpd 函式讀取一個位元組、文字和一個 Double Word,分別,從指定的輸入連接埠。 輸入值可以是 0 – 65,535 的不帶正負號的短整數。

由於這些函式直接從 I/O 埠讀取,它們可能無法用來在 Windows NT、Windows 2000、Windows XP 和 Windows Server 2003 的使用者程式碼。

需求

程序

必要的標頭檔

_inp

<conio.h>

_inpw

<conio.h>

_inpd

<conio.h>

如需更多關於相容性的資訊,請參閱入門介紹中的 相容性 (Compatibility)

程式庫

所有的 C 執行階段程式庫 (C run-time libraries) 版本。

.NET Framework 對等用法

不適用。若要呼叫標準 C 函式,請使用 PInvoke。如需更多的資訊,請參閱 Platform Invoke Examples

請參閱

參考

主控台和連接埠的 I/O

_outp,_outpw _outpd