1. linux int snprintf(char *restrict buf, size_t n, const char * restrict format, ...);
windows int _snprintf(
2. 头文件都是string. h windows平台:函数:stricmp(char *str1, char *str2), strnicmp(char *str1, char *str2, size_t n). Linux平台: 函数:strcasecmp(char *str1, char *str2), strncasecmp(char *str1, char *str2, size_t n).
3. linux环境下是:vsnprintf VC6环境下是:_vsnprintf AString.cpp linux vasprintf() static int vasprintf(char **strp, const char *fmt, va_list va) { const int required = vsnprintf(NULL, 0, fmt, va); char *const buffer = (char *) malloc(required + 1); const int ret = vsnprintf(buffer, required + 1, fmt, va); *strp = buffer; return ret; }
4. windows下winsock.h/winsock2.h linux下sys/socket.h 错误处理:errno.h
5. write windows头文件 include unistd.h
6. socklen_t windows 头文件 #include<ws2tcpip.h> linux 下头文件 1)#include <sys/socket.h> 2)#include <unistd.h> |