2024年1月11日

C语言 指针偏移量计算

摘要: #include <stdio.h> struct s { int a; int b; }; int main() { struct s s1; // (struct s*)0表示0x0作为struct s首地址 // &((struct s*)0)->a代表a地址 // 因为struct s首地址 阅读全文

posted @ 2024-01-11 08:36 王景迁 阅读(80) 评论(0) 推荐(0) 编辑

网卡IP是32位掩码时无法设置路由

摘要: 当网卡IP地址是32位掩码时,不管是同网段,还是跨网段,添加带有下一跳的路由时报错网络不可达,因为32位掩码意味着不存在链路层路由。 onlink参数作用是强制说明网关是在链路层上,可以把路由加上。 阅读全文

posted @ 2024-01-11 08:02 王景迁 阅读(35) 评论(0) 推荐(0) 编辑

导航