随笔分类 - C++
摘要:1、generated debug assertion -- File: docsingl.cpp Line: 215 MFC程序vs2008编译通过,运行时出错,无法打开,提示f:\dd\xxxx的docsingl.cpp中的210行,找到以下代码: void CSingleDocTemplate
阅读全文
摘要:模板友元函数在类内声明类外定义时都必须加模板前缀,另外模板要写在一个文件内// generates undefined error for the operator#include #include template class array { int size;public: array(); t...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml;using System.IO;using System.Windows.Forms;namespac...
阅读全文
摘要://Mylog.h如下:#pragma once//#include #include #include #include "log4cpp/FileAppender.hh"#include #include "log4cpp/NTEventLogAppender.hh"#include #include //#include "log4cpp/SyslogAppender.hh"#include #include #include #include #include #include #include #include #inclu
阅读全文
摘要:一、简介:log4cplus是C++编写的开源的日志系统. 具有线程安全、灵活、以及多粒度控制的特点,通过将信息划分优先级使其可以面向程序调试、运行、测试、和维护等全生命周期; 你可以选择将信息输出到屏幕、文件、NT event log、甚至是远程服务器;通过指定策略对日志进行定期备份等等。二、基本...
阅读全文
摘要:// TestShlwAPI.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include using std::wcout;using std::endl;#include using std::wstring;#include using std::wifstream;int _tmain(int argc, _TCHAR* argv[]){ //main.cpp://读我自己 wifstream fin("TestShlwAPI.cpp"); wstring str; wchar_t wcharArr[1024
阅读全文
摘要:// XMLT01.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include "tinyxml2.h"using namespace std;using namespace TinyXml2;void ReadTest01XML(){XMLDocument doc;doc.LoadFile("Test01.xml");const char * content = doc.FirstChildElement("test")->GetText();pri
阅读全文
摘要:插入排序1.直接插入排序原理:将数组分为无序区和有序区两个区,然后不断将无序区的第一个元素按大小顺序插入到有序区中去,最终将所有无序区元素都移动到有序区完成排序。要点:设立哨兵,作为临时存储和判断数组边界之用。实现:Void InsertSort(Node L[],int length){Int i...
阅读全文
摘要:Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平...
阅读全文
摘要:STL概述STL的一个重要特点是数据结构和算法的分离。尽管这是个简单的概念,但这种分离确实使得STL变得非常通用。例如,由于STL的sort()函数是完全通用的,你可以用它来操作几乎任何数据集合,包括链表,容器和数组。要点STL算法作为模板函数提供。为了和其他组件相区别,在本书中STL算法以后接一对...
阅读全文