inet_ntoa

inet_ntoa

inet_ntoa的原型是char*inet_ntoa,作業系統是Win2000 Professional或更高版本,參數是一個網路上的IP位址。

基本介紹

  • 中文名:inet_ntoa
  • 原型:char*inet_ntoa
  • 作業系統:Win2000 Professional或更高版本
  • 參數:IP位址的網路位元組序
基本介紹,英文原意,基本要求,編程舉例,

基本介紹

功能:
將一個十進制網路位元組序轉換為點分十進制IP格式的字元串。
原型:
char*inet_ntoa(struct in_addr in);
頭檔案:
arpa/inet.h
Winsock2.h
參數:
一個網路上的IP位址
返回值:
如果正確,返回一個字元指針,指向一塊存儲著點分格式IP位址的靜態緩衝區(同一執行緒內共享此記憶體);錯誤,返回NULL。

英文原意

The inet_ntoa function converts an (Ipv4) Internet network address into a string in Internet standard dotted format.
char FAR * inet_ntoa( struct in_addr in);
Parameters
in
[in] Structure that represents an Internet host address.
Return Values
If no error occurs, inet_ntoa returns a character pointer to a static buffer containing the text address in standard ".'' notation. Otherwise, it returns NULL.
Remarks The inet_ntoa function takes an Internet address structure specified by the in parameter and returns an ASCII string representing the address in ".'' (dot) notation as in "a.b.c.d.'' The string returned by inet_ntoa resides in memory that is allocated by Windows Sockets. The application should not make any assumptions about the way in which the memory is allocated. The data is guaranteed to be valid until the next Windows Sockets function call within the same thread—but no longer. Therefore, the data should be copied before another Windows Sockets call is made.

相關詞條

熱門詞條

聯絡我們