Chinaunix首页 | 论坛 | 博客
  • 博客访问: 108236
  • 博文数量: 74
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 757
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-20 22:42
个人简介

相信生命中的无限潜能

文章分类

全部博文(74)

文章存档

2016年(1)

2015年(30)

2014年(30)

2013年(13)

我的朋友

分类: C/C++

2014-02-24 11:44:17


  1. #include <stdio.h>
  1. #include <netdb.h>
  1. /* getprotobyname 得到协议号
  1.  *
  1.  */
  1. int main()
  1. {
  1.     struct protoent *ent;
  1.     ent=getprotobyname("icmp");
  1.     printf("%d\n",ent->p_proto);
  1. }
  1. 执行结果
  1.    [root@os 09dir]# ./a.out
  1.     1
  1.    [root@os 09dir]#

  1.  

阅读(835) | 评论(0) | 转发(0) |
0

上一篇:semget信号量

下一篇:uname

给主人留下些什么吧!~~