大约有 44,000 项符合查询结果(耗时:0.0339秒) [XML]
libcurl网络连接使用tcp/ip - C/C++ - 清泛网 - 专注C/C++及内核技术
...络连接使用tcp ip,部分代码如下:CURL *curl;CURLcode res;const char *request = "GETas.xxxxE测试发送"; curl_socket_t sockfd; * socket * ...部分代码如下:
CURL *curl;
CURLcode res;
const char *request = "GETas.xxxxE测试发送";
curl_socket_t sockfd; /* socket */
l...
c++ 写日志通用类,可设置日志级别 - C/C++ - 清泛网 - 专注C/C++及内核技术
... Log(int nLevel, LPCSTR func, INT line, LPCTSTR fmt, ...);
static const char * const LOGGER_LEVEL_NAME[] = {"崩溃", "错误", "警告", "信息", "详细", "调试"};
static const char * const LOGGER_LEVEL_CODE[] = {"FATAL", "ERROR", "WARN ", "INFO ", "VERBOSE", "DEBUG"};
#define logging(nL...
atol 头文件 - C/C++ - 清泛网 - 专注C/C++及内核技术
...数名:atol功能: 把字符串转换成长整型数用法: longatol(const char *nptr);程序例:#include <stdlib.h> #includ...#include <stdlib.h>
函数名: atol
功 能: 把字符串转换成长整型数
用 法: long atol(const char *nptr);
实例:
#include <stdlib.h>
#include <s...
C++ 通过主机名/域名获取IP - C/C++ - 清泛网 - 专注C/C++及内核技术
...中用到Winsock API 函数,都要用到 Ws2_32.lib
void GetHostIP(char *szIPAddr)
{
WSADATA wsaData;
char name[155]; //定义用于存放获得主机名的变量
char *ip; //定义IP地址变量
PHOSTENT hostinfo;
//调用MAKEWORD()获得Winsocl版本的正确值...
std::stringstream ss; 直接使用ss.str().c_str() 字符串指针可能导致崩溃 ...
....str().c_str() 字符串指针可能导致崩溃std::stringstream ss;const char* ch = ss str() c_str();call_func(ch);这种写法在系统内存不足时,ss会立马释放内存,字符串指针ch可能会非法访问导致崩溃。代码最好的是
std::stringstream ss;
const char* ch = ss...
boost库编译问题 - 更多技术 - 清泛网 - 专注C/C++及内核技术
...ee::xml_writer_settings<std::string> settings(' t', 1, "GB2312");报错:char不能转换为std::string。1.5...boost::property_tree::xml_writer_settings<std::string> settings('\t', 1, "GB2312");
报错:char不能转换为std::string。
1.54 版本 报错,改为boost::property_tree::xml_wr...
VC/Linux C++ 递归访问目录下所有文件 - c++1y / stl - 清泛IT社区,为创新赋能!
VC函数,部分代码如下:find(char * lpPath)
{
char szFind[MAX_PATH];
WIN32_FIND_DATA FindFileData;
strcpy(szFind,lpPath);
strcat(szFind,"\\*.*");
HANDLE hFind=::FindFirstFile(szFind,&FindFileData);
&...
Capturing “Delete” Keypress with jQuery
... keydown event because the keypress event is intended for real (printable) characters. keydown is handled at a lower level so it will capture all nonprinting keys like delete and enter.
share
|
impr...
How do I detect unsigned integer multiply overflow?
... addcarry_u8 or subborrow_u64). Their signature is a bit obtuse:
unsigned char _addcarry_u32(unsigned char c_in, unsigned int src1, unsigned int src2, unsigned int *sum);
unsigned char _subborrow_u32(unsigned char b_in, unsigned int src1, unsigned int src2, unsigned int *diff);
c_in/b_in is the c...
How do you pass a function as a parameter in C?
...&dosomething;
func();
For a function that returns an int and takes a char you would do
typedef int (*functiontype2)(char);
and to use it
int dosomethingwithchar(char a) { return 1; }
functiontype2 func2 = &dosomethingwithchar
int result = func2('a');
There are libraries that can hel...