/*************************************** *********************************
*
* Map features: 1. Store Key-value pairs
* 2. Quick search is supported. The search complexity is basically Log (N)
* 3. Fast insertion, fast deletion, and quick
-------------- ErrorCorrelator. h ---------------------------------------------- # include
# Include
# Include
# Include
// Error class declaration
Class Error
{
Public:
Error (int priority, std: string errMsg ):
MPriority (priority), mError
1
# Ifdef _ XXXX
... Procedure 1...
# Else
Www.2cto.com
... Procedure 2...
# Endif
This indicates that if the identifier _ XXXX has been defined by the # define command, the program segment 1 will be compiled; otherwise, the program
------------------------------------------- XMLElement. h --------------------------------------------------
# Include
# Include
# Include
# Include
Using namespace std;
Class XMLElement
{
Public:
XMLElement ();
Void setElementName
Master the key points of C/C ++ (5) -- mutable and volatile
14. Variable Length Parameters
It is possible to design a function with variable number of parameters and variable parameter types. The most common examples are printf, scanf, and
1. object initialization in the same compilation unit.
Class PhoneNumber {.....};
Class Info
{
Public:
Info (const std: string name, const std: string address, const std: list phonenum): m_Name (name), m_Address (address ), m_PhoneNum (phonenum)
{
I wrote a code today and I always reported an error. It was originally a left-handed Problem of a string, but I was always bored when I reported an error. Then I went online to answer questions from enthusiastic netizens, and I was very
The question is shown in the question.
The Code is as follows:
Www.2cto.com
Int findSubStringNUM (const char * targetString, const char * subString ){
Assert (NULL! = TargetString | NULL! = SubString );
Int I = 0;
Int j = 0;
Int num = 0;
While
13.5.2 define value typeObjects defined by classes with value semantics act like arithmetic objects, and vice versa. The string class is an example of a value type class.The copy constructor no longer copies pointers. It will allocate a new int
14.2 input and output operatorsI/O operation interfaces provided by classes that support I/O operations should be the same as those defined in the standard library iostream for built-in types. Therefore, many classes need to overload the input and
According to the introduction in the design pattern book:
Intent:
Use a prototype instance to specify the type of the object to be created, and copy the prototype to create a new object.
Applicability:
When a system should be created, constructed,
Clause 14: copying actions in resource management
Think carefully about copying behaviorin resource-managing classes
Clause 13 describes the Resource Acquisition IsInitialization (RAII) principle as the pillar of Resource management, and describes
In the C ++ multi-inheritance system, you can override virtual functions in different base classes in the derived classes. The following is an example:
[Cpp]Class CBaseA{Public:Virtual void TestA ();};Class CBaseB{Public:Virtual void TestB
In terms of concept, constructor can be considered to be implemented in two phases:1. Initialization phase;2. Common computing stage. (The computing stage consists of all the statements in the constructor)Whether or not the Members display
I wrote a String class without copying constructor, but there is a copy assignment operator.
Code:
01# Include 02# Include 03Using namespace std;04 05Class String06{07Public:08String (): data (0) {cout 09String (const char * str): data (0)10{11Int
Function of the extern keyword
1. Declare external variables or functions
When the variables or functions you need are in another file, in addition to include, you can also use extern to declare external variables or functions.
// File1.cppInt;Int
There are many reasons for using expat, mainly because expat is more flexible. I used TinyXML, but I was not very familiar with expat at the beginning. It was actually very easy to get started.1. Callback Function
The following cases describe the
Q: What are '_ FILE _' and '_ LINE __'?
A: '_ FILE _' and '_ LINE _' are predefined macros and part of the C/C ++ standard. during preprocessing, they are replaced respectively by a constant string holding the current file name and by a integer
The parameter format of the non-type template is the same as that of the following type.• Integer or enumeration• Pointing to an object or function• Reference an object or function• Point to a memberDeclare non-type template parameters as an array
Today, I simply flipped through Folly. Basically, the databases in it won't be useful to normal people. I thought it would be highly dependent on modules like Boost. I didn't expect it to be enough. It is not very difficult to extract features.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service