大约有 42,000 项符合查询结果(耗时:0.0259秒) [XML]
scoped_ptr 与 auto_ptr 与 shared_ptr 区别总结 - C/C++ - 清泛网 - 专注C/C++及内核技术
...cout<<p.use_count()<<"::"<<p.get()<<std::endl;
}
#include <algorithm>
char upCase(char c)
{
return toupper(c);
}
int _tmain(int argc, _TCHAR* argv[])
{
shared_ptr<Foo> sp1(new Foo());
shared_ptr<Foo> sp2(sp1);
shared_ptr<Foo> sp3;
sp1->print();
sp2->print();
std::cout<<sp1...
半个汉字的校验与处理(C++) - C/C++ - 清泛网 - 专注C/C++及内核技术
...
// strSrc: 原始字符串
// nMaxLen: 截断后的最大长度
char *GetTruncate(char *strSrc, int nMaxLen)
{
if (strSrc == NULL || nMaxLen == 0)
{
return NULL;
}
int len = strlen(strSrc);
if (len == 0)
{
...
C++中判断文件、目录是否存在的几种方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...种方式是直接调用c的函数库。
就是函数 int _access(const char* path,int mode);
这个函数的功能十分强大。
可以看看msdn的详细介绍
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
// Check for existence.
if( (_access( "c...
vc/mfc *通配符 批量删除文件 - C/C++ - 清泛网 - 专注C/C++及内核技术
...tion函数:#include "stdafx.h"#include <windows.h>int _tmain(int argc, _TCHAR*...直接上代码,可直接运行亲测有效,使用SHFileOperation函数:
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
LPTSTR delFileName = L"c:/test/test*.txt"...
C语言面试那些事儿──一道指针与数组问题 - C/C++ - 清泛网 - 专注C/C++及内核技术
...─一道指针与数组问题首先看如下代码:int main(int argc, char** argv){ int a[5] = {1,2,3,4,5}; int* ptr = (int*)(&a + 1); ...首先看如下代码:
int main(int argc, char** argv)
{
int a[5] = {1,2,3,4,5};
int* ptr = (int*)(&a + 1);
printf("%d,%d\n", *(a+1...
std::string的截取字符串的方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...ndex).c_str();
//port
ip.substr(index + 1).c_str();
int find_first_of(char c, int start = 0):
查找字符串中第1个出现的c,由位置start开始。 如果有匹配,则返回匹配位置;否则,返回-1.默认情况下,start为0,函数搜索整个字符串。
int find...
sizeof、strlen简单总结 - C/C++ - 清泛网 - 专注C/C++及内核技术
sizeof、strlen简单总结sizeofstrlenconst char* p4字符串长度std::string4字符串长度"......"字符串长度+1 (' 0')字符串长度
sizeof
strlen
const char* p
4
字符串长度
std::string
4
字符串长度
"......"
字符串长度+1 ('\0')...
c/c++如何获取CPU的序列号? - C/C++ - 清泛网 - 专注C/C++及内核技术
...0;
unsigned long st2 = 0;
unsigned long s1,s2;
unsigned char vendor_id[]="------------";
char CPUSERIAL[20];
memset(CPUSERIAL,0,20);
__asm{
xor eax,eax
cpuid
mov dword ptr vendor_id,ebx
mov dword ptr vendor_id[+4],edx
mov dword p...
error C2758: “ConstInit::cival”: 必须在构造函数基/成员初始值设定项列...
... int ival;
const int cival;
int &rival;
};
int main(int argc, char *argv[])
{
ConstInit ci;
}
这里引用类型rival以及const类型cival都没有在初始化列表中初始化,因此报错。解决办法就是在初始化列表中初始化这些特殊的类成员。如下...
Discuz! X3 论坛标题字数突破80的限制 - 更多技术 - 清泛网 - 专注C/C++及内核技术
...分来修改:
一、修改数据库subject字段的长度,默认都是char(80);
二、修改JS验证字符数文件;
三、修改模板中写死的字符限制数;
四,修改函数验证文件;
五,修改语言包文件。
修改的文件一览如下(数据库修改 _forum_po...