![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
XINCHUN2017
作IT行业达人
展开
-
Linux系统大小端判断
大小端定义小端(LITTLE_ENDIAN): 低位字节存放在内存的低端地址,高位字节存放在内存的高端地址;大端(BIG_ENDIAN): 高位字节存放在内存的低端地址,低位字节存放在内存的高端地址。例程源码文件: endian.c编 译: gcc -o endian endian.c执 行: ./endian代码...原创 2020-04-17 21:44:00 · 1441 阅读 · 0 评论 -
判断一个无符号整数是否为2的幂次方
判断一个无符号整数是否为2的幂次方 Number to check: if n is a power of 2/*** Returns true if n is a power of 2* @param n* @return 1 if true, 0 otherwise*/static inline int x_is_power_of_2(unsinged int...原创 2018-09-09 13:16:21 · 1815 阅读 · 0 评论 -
Linux epoll服务端
Linux epoll服务端源代码:epollServer.cpp/******************************************************************************** epollServer.cpp** Create on 2018-10-6* Author: yanxinchun** g++ -o epoll...原创 2018-10-10 20:10:25 · 389 阅读 · 0 评论 -
Linux epoll客户端
Linux epoll客户端源代码:epollClient.cpp/******************************************************** epollClient.cpp** Create on 2018-10-6* Author: yanxinchun** g++ -o epollClient epollClient.cpp*...原创 2018-10-10 20:17:53 · 1178 阅读 · 0 评论 -
Linux poll服务端
Linux poll服务端源代码:pollServer.cpp/******************************************************************************** pollServer.cpp** Create on 2018-10-6* Author: yanxinchun** g++ -o pollServ...原创 2018-10-10 23:19:55 · 267 阅读 · 0 评论 -
Linux poll客户端
Linux poll客户端源代码:pollClient.cpp/******************************************************** pollClient.cpp** Create on 2018-10-6* Author: yanxinchun** g++ -o pollClient pollClient.cpp******...原创 2018-10-10 23:29:51 · 465 阅读 · 0 评论