摘要: 1. 根据ifconfig中相应网口的RUNNING字段检查 int check_net(const char *eth) { int ret = 1; char buf[256]; FILE *fp; memset(buf, 0, 256); sprintf(buf, "ifconfig %s | 阅读全文
posted @ 2016-11-21 01:19 yuxi_o 阅读(813) 评论(0) 推荐(0) 编辑
摘要: 1. struct中函数 结构体中函数占用字节数:32位主机占用4个字节,64位主机占用8个字节。 结构体中函数本质是指针,占用字节数与指针相同。 #include <stdio.h> struct student_st { char name[20]; int no; void (*show)(s 阅读全文
posted @ 2016-11-21 00:25 yuxi_o 阅读(699) 评论(0) 推荐(0) 编辑