报名参加的理由是:
书山有路勤为径,一切为了爬山
我的学习计划是:
1、买本书
2、和大家一起学
3、学以致用
我的购书链接是:
https://item.jd.com/11821338.html
2018年5月19日学习记录
带着问题去学习,今天遇到一个问题,如何获得一个域名的ip地址,网上查询了一些资料,配合自己的开发调试工具
#include <stdio.h> #include <netdb.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { struct hostent *h; if((h=gethostbyname("mikuq.com"))==NULL) { fprintf(stderr,"不能得到IP\n"); return 1; } printf("%s\n",inet_ntoa(*((struct in_addr *)h->h_addr))); return 0; }
实际调试环境