?? gethostn.c
字號:
/* gethostn.c: * * Example of gethostname(2) : */#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <string.h>intmain(int argc,char **argv) { int z; char buf[32]; z = gethostname(buf,sizeof buf); if ( z == -1 ) { fprintf(stderr,"%s: gethostname(2)\n", strerror(errno)); exit(1); } printf("host name = '%s'\n",buf); z = getdomainname(buf,sizeof buf); if ( z == -1 ) { fprintf(stderr,"%s: getdomainname(2)\n", strerror(errno)); exit(1); } printf("domain name = '%s'\n",buf); return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -