文章分类 -  C++笔记

对C++的一些新的认识,记录下来
WideCharToMultiByte and MultiByteToWideChar
摘要:bool UnicodeToAnsi(const wchar_t* lpString, char* szAnsi)//(in,out) { char* pWideCharStr; int nLenOfWideChar, nReturnlen; nLenOfWideChar = WideCharToM 阅读全文
posted @ 2016-11-01 16:55 carekee 阅读(376) 评论(0) 推荐(0) 编辑
list使用中遇到的erase问题(List Iterator Not Incrementable)
摘要:在VS2005中使用list的erase遇到了"List Iterator Not Incrementable"问题举个例子:1.list<int> sList;list<int>::iterator sP;sList.push_back(1);sList.push_back(3);sList.push_back(5);sList.push_back(7);for (sP ... 阅读全文
posted @ 2010-04-22 11:49 carekee 阅读(8281) 评论(0) 推荐(0) 编辑
仅运行一个实例
摘要:在InitInstance()添加互斥变量:CreateMutex(NULL, FALSE, "ApplicationName");if(GetLastError()==ERROR_ALREADY_EXISTS){MessageBox(NULL,_T("您已经启动应用程序,不能两个应用程序同时启动!"),"MessageBoxName",MB_OK);return FALSE;}CreateMut... 阅读全文
posted @ 2009-12-18 11:04 carekee 阅读(429) 评论(0) 推荐(0) 编辑
二级指针初始化
摘要:int **temp;int i = 0;//初始化temp = new int*[100];for(i = 0; i < 100; i++)  temp[i] = new int[200];//释放for(i = 0; i < 100; i++)  delete []temp[i];delete []temp;可以理解为temp[100][200];因为在VC中直接定义过大的二维数组... 阅读全文
posted @ 2009-12-17 15:58 carekee 阅读(3614) 评论(0) 推荐(0) 编辑


点击右上角即可分享
微信分享提示