摘要: asctime(将时间和日期以字符串格式表示) 相关函数time,ctime,gmtime,localtime表头文件#include<time.h>定义函数char * asctime(const struct tm * timeptr);函数说明asctime()将参数timeptr所指的tm结构中的信息转换成真实世界所使用的时间日期表示方法,然后将结果以字符串形态返回。此函数已经由时区转换成当地时间,字符串格式为:“Wed Jun 30 21:49:08 1993\n”返回值若再调用相关的时间日期函数,此字符串可能会被破坏。此函数与ctime不同处在于传入的参数是不同的结构。 阅读全文
posted @ 2011-10-28 15:30 lcryby 阅读(181) 评论(0) 推荐(0) 编辑
摘要: socket相关程序从Windows移植到Linux下需要注意的:1)头文件 Windows下winsock.h/winsock2.h Linux下sys/socket.h 错误处理:errno.h2)初始化 Windows下需要用WSAStartup Linux下不需要3)关闭socket Windows下closesocket(...) Linux下close(...)4)类型 Windows下SOCKET Linux下int 如我用到的一些宏: #ifdef WIN32 typedef int socklen_t; typedef int ssize_t; #endif#ifdef __ 阅读全文
posted @ 2011-10-28 11:19 lcryby 阅读(1664) 评论(1) 推荐(0) 编辑