Windows Sockets编程
yueyaquanBoy
这个作者很懒,什么都没留下…
展开
-
关于gethostname函数失败的问题
调用gethostname之前, 要先调用WSAStartup才可以, 否则gethostname会失败!下面是正确的代码转载 2014-04-17 14:57:50 · 2656 阅读 · 0 评论 -
十进制转二进制(移位法)
#include int main(){ char strBinary[sizeof(int)*8+1]; int a = 100; // 让p指向strBinary的最后一位 char *p = strBinary + sizeof(int)*8; *p = '/0'; while (a) { --p; *p = (a & 1) + 0x30; // 加0x30转变成字转载 2014-04-17 14:59:20 · 1248 阅读 · 0 评论