摘要:
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int inet_aton(const char *cp, struct in_addr *inp); in_addr_t inet_addr(const c 阅读全文
posted @ 2020-07-26 20:15
一骑红尘妃子笑!
阅读(175)
评论(0)
推荐(0)
摘要:
#define __SOCKADDR_COMMON(sa_prefix) sa_family_t sa_prefix##family 这个宏用于为套接字地址(socket addresses),如“ struct sockaddr”,“ struct sockaddr_in”等,声明数据类型的公共成 阅读全文
posted @ 2020-07-26 17:17
一骑红尘妃子笑!
阅读(382)
评论(0)
推荐(0)
摘要:
#include <arpa/inet.h> uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint16_t ntohs(uint16_ 阅读全文
posted @ 2020-07-26 14:20
一骑红尘妃子笑!
阅读(278)
评论(0)
推荐(0)
摘要:
判断标准:内存低地址存放数据低字节,则为小端字节序,否则为大端字节序。ps:网络字节序是大端字节序。 对于数据:0X12345678 测试代码: #include <iostream> #include <stdint.h> using namespace std; int main(){ int 阅读全文
posted @ 2020-07-26 13:59
一骑红尘妃子笑!
阅读(230)
评论(0)
推荐(0)
摘要:
时间限制:3000ms 内存限制:589824Kb 题目描述: 有一种排序算法定义如下,该排序算法每次只能把一个元素提到序列的开头,例如2,1,2,4,只需要一次操作把1提到序列起始位置就可以使得原序列从小到大有序。现给你个乱序的1-N的的排序,请你计算最少需要多少次操作才可以使得原序列从小到大有序 阅读全文
posted @ 2020-07-26 10:40
一骑红尘妃子笑!
阅读(482)
评论(0)
推荐(0)
摘要:
NAME socket - create an endpoint for communication SYNOPSIS #include <sys/types.h> #include <sys/socket.h> int socket(int domain, int type, int protoc 阅读全文
posted @ 2020-07-26 10:11
一骑红尘妃子笑!
阅读(160)
评论(0)
推荐(0)
浙公网安备 33010602011771号