⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protoent.c

📁 目前已经有很多介绍计算机网络的书籍
💻 C
字号:
/* protoent.c: *  * Example getprotoent(3) program : */#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include <netdb.h>intmain(int argc,char **argv) {    int x;    struct protoent *pp;    for (;;) {        errno = 0;        if ( !(pp = getprotoent()) )            break;        printf("%s:\n"            "\tProtocol: %d\n"            "\tAliases:  ",            pp->p_name,            pp->p_proto);        for ( x=0; pp->p_aliases[x] != NULL; ++x )            printf("%s ",pp->p_aliases[x]);        putchar('\n');    }    if ( errno != 0     &&   errno != ENOENT ) /* For RH-6.0 */        fprintf(stderr,            "%s: getprotoent(3) %d\n",            strerror(errno),errno);    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -