The correct way to initialize a dynamic pointer to a multidimensional array
摘要:From:https://stackoverflow.com/questions/18273370/the-correct-way-to-initialize-a-dynamic-pointer-to-a-multidimensional-array Let's start with some ba
阅读全文
posted @
2018-05-30 10:26
今夜太冷
阅读(164)
推荐(0) 编辑
wcstombs_s 宽字节转多字节
摘要:From: https://blog.csdn.net/ychw365/article/details/7034950
阅读全文
posted @
2018-05-30 09:46
今夜太冷
阅读(812)
推荐(0) 编辑
HOW TO REPLACE ALL OCCURRENCES OF A CHARACTER IN A STD::STRING
摘要:From: http://www.martinbroadhurst.com/replacing-all-occurrences-of-a-character-in-a-stdstring.html This can be done using the standard library or Boos
阅读全文
posted @
2018-05-23 17:22
今夜太冷
阅读(168)
推荐(0) 编辑
one or more multiply defined symbols found
摘要:在一个c++的.h文件中加入了这段代码: #include <string> using namespace std; std::string escapeStr(const std::string& input) { return std::string(input); } 结果总是报错: one
阅读全文
posted @
2018-05-23 16:11
今夜太冷
阅读(3629)
推荐(0) 编辑
Std::map too few template arguments
摘要:在上述的代码中,红色波浪线的部分编译的时候报错: error C2976: 'std::map' : too few template arguments 换成std::map<std::string, std::string>也是一样的错误. 怎么回事那? [解决方法] 包含 map就可以了. #
阅读全文
posted @
2018-05-22 14:24
今夜太冷
阅读(1981)
推荐(0) 编辑
C++中的extern
摘要:这篇文章解释的简单明了: https://stackoverflow.com/questions/10422034/when-to-use-extern-in-c This comes in useful when you have global variables. You declare the
阅读全文
posted @
2018-04-18 16:18
今夜太冷
阅读(250)
推荐(0) 编辑
error MSB6006: "CL.exe" exited with code -1073741819.
摘要:编译一个c++项目的时候,会报如下的错误,总是无法编译,是怎么回事? error MSB6006: "CL.exe" exited with code -1073741819. 搜了一些网上的解决方案都不好用。 【解决方法】 选择一个cpp文件,右击properties, 然后看了一遍它的设置,没做
阅读全文
posted @
2018-04-08 10:46
今夜太冷
阅读(3739)
推荐(0) 编辑
Simple XOR Encryption/Decryption in C++ (And Several Other Languages)
摘要:For details on how to implement XOR encryption using Go, see this post. If you are looking for XOR encryption for other languages, including C, C#, Da
阅读全文
posted @
2018-04-06 20:35
今夜太冷
阅读(257)
推荐(0) 编辑
The application was unable to start correctly (0xc000007b)
摘要:用VS2013建立了一个c++ console application,然后引用了一个DLL, 启动的时候报错: The application was unable to start correctly (0xc000007b) 哪怕是如下最简单的代码也报错: #include "stdafx.h" int _tmain(int ...
阅读全文
posted @
2018-03-30 20:17
今夜太冷
阅读(5862)
推荐(0) 编辑
FreeType的项目总是报error LNK2019: unresolved external symbol __imp错误
摘要:用vs2013建立了一个c++的项目,然后在根目录放置了freetype.lib,将GitHub上面的include文件夹拷贝到本机,并且在VS中设置了额外包含目录指向这个inluce文件夹,然后将freetype.dll拷贝到Debug目录下,然后程序中用了如下的代码: #include "stdafx.h" #include "FreeTypeH...
阅读全文
posted @
2018-03-29 20:32
今夜太冷
阅读(682)
推荐(0) 编辑
c++ string wstring 字符串替换
摘要:intCStringTool::Replace(std::wstring&strContent,std::wstring&strReplace,std::wstring&strDest) { while(true) { size_tpos=strCon...
阅读全文
posted @
2018-03-05 11:57
今夜太冷
阅读(1054)
推荐(0) 编辑
如何拷贝一个wchar_t类型的字符串
摘要:Do this, wchar_t clone[260]; wcscpy(clone,szPath); Or, if you want to allocate memory yourself, wchar_t *clone = new wchar_t[wcslen(szPath)+1]; wcscpy
阅读全文
posted @
2018-02-28 19:58
今夜太冷
阅读(5237)
推荐(1) 编辑
ifdef ANDROID总是不好用
摘要:在vs的proprocessor definition中定义了ANDRIOD, 但是执行下面的代码的时候,总是说ANDROID is not defined. #ifdef ANDROID LOGW("engine_init_display: ANDROID is defined."); #else ...
阅读全文
posted @
2017-12-19 20:05
今夜太冷
阅读(466)
推荐(0) 编辑
mysql CAPI 接口 读取中文乱码的解决方案(转)
摘要:最近的yymysqlsdk的开源项目里,对中文的支持不到位,因此用了1.5天的时间,对中文处理的各个情况进行了分析。 1.首先确认你的MySQL配置文件,my.ini (只针对windows)里的配置,如没有则添加 [client] default-character-set=gbk (是为了,开发客户端程序时,对中文的支持;如果此处设置为utf8,我没有验证过,稍后验证,...
阅读全文
posted @
2017-07-23 10:45
今夜太冷
阅读(690)
推荐(0) 编辑
转:C++操作mysql方法总结(1)
摘要:原文:http://www.cnblogs.com/joeblackzqq/p/4332945.html C++通过mysql的c api和通过mysql的Connector C++ 1.1.3操作mysql的两种方式 使用vs2013和64位的msql 5.6.16进行操作 项目中使用的数据库名为booktik 表为book ………. (共有30...
阅读全文
posted @
2017-07-22 17:58
今夜太冷
阅读(823)
推荐(0) 编辑
Return array from functions in C++
摘要:C++ does not allow to return an entire array as an argument to a function. However, you can return a pointer to an array by specifying the array's name without an index. If you want to return a single...
阅读全文
posted @
2017-07-22 13:42
今夜太冷
阅读(238)
推荐(0) 编辑
(转)Debug Assertion Failed! Expression: _pFirstBlock == pHead
摘要:最近在VS上开发C++程序时遇到了这个错误: Debug Assertion Failed! Expression:_pFirstBlock == pHead 如图: 点击Abort之后,查看调用栈,发现异常在函数return时被时产生,进一步看是vector的析构函数被调用时产生,以前没开发过C++项目,没什么经验,这个错误让我很困惑,第一,我电脑上并没有f盘;第二,我并没...
阅读全文
posted @
2017-06-15 17:33
今夜太冷
阅读(945)
推荐(0) 编辑
External component has thrown an exception
摘要:C#调用c++的DLL报错:External component has thrown an exception, 也没有log产生,怎么回事那? 【解决方法】 这是因为c++的程序报错了,而且没有catch,就报这个错误了。
阅读全文
posted @
2017-03-21 09:57
今夜太冷
阅读(1772)
推荐(0) 编辑
MFC获得当前用户等信息
摘要:MFC获得当前用户等信息 #ifndef UNICODE #define UNICODE #endif #pragma comment(lib, "netapi32.lib") #include <stdio.h> #include <windows.h> #include <lm.h> int w
阅读全文
posted @
2017-02-04 09:45
今夜太冷
阅读(268)
推荐(0) 编辑