# Include # include using namespace STD; // E is the query value, and K is the return value template class skipnode {public: skipnode (INT size) {link = new skipnode * [size];} ~ Skipnode () {Delete [] link;} e data; skipnode ** link; //
// Formula-based linearlist # include # include #include using namespace STD; Template class linearlist {public: linearlist (INT maxlistsize = 10); // constructor, the default maximum value is 10 ~ Linearlist () {Delete [] element;} // destructor
/*************************************** **************************************** **************************************** * ********** // Experiment 3: linear table operation/* 1. create a linear table class. The storage structure of linear tables
# Include Using STD: cout;Using STD: Endl;Typedef int (* PF) (int I );
Int F2 (int I){Return I;}
Int F3 (int I){Return 2 * I;}
Pf f (bool B) // the first declaration method// Int (* F (bool B) (int I) // method 2{Return (B? F2: F3 );}
Int
# Include using namespace STD; Template class sortedchainnode {public: E data; sortedchainnode * link ;}; template class sortedchain {public: sortedchain () {First = 0 ;}~ Sortedchain (); bool isempty () const {return first = 0;} int length ()
In C ++, function parameters are transmitted in three ways:Value Transfer, pointer transfer, and reference transfer.
1. "value transfer" ExampleProgram.
Void fun1 (int x ){X = x + 10;}
Execution piece:
Int n = 0;Fun1 (N );Cout
I have been reading C ++ primer version 4 and C ++ Programming Tutorial (edited by Qian Neng)
In section 4.2.4 of "C ++ primer version 4", section 8.3 of "C ++ Programming Tutorial" has knowledge about pointers and arrays.
I call the former A and
# Include # Include # Include Using namespace STD;// Display all ballsInline void show (const int ball [], int Len ){For (INT I = 0; I Cout }Cout }// Initialize 13 ballsInline void Init (INT ball [], int Len ){For (INT I = 0; I Ball [I] = 2;}}//
I read Lin Rui's high-quality programming guide 8.2.2 confusing hidden rules. (here, the hidden function of the derived class shields the base class functions with the same name)
This section is well written: 1. List the hidden situations.
2. The
.keywordlink{ background: #666; }-->Cctype (ctype. h)
handling of characters in string objects in section 3.2.4
section 6.3 character function library cctype (more detailed than the previous isblank Introduction)Header
Character Handling
Typedef unsigned int size_t;
Size_t is actually an unsigned int;
In the array loop, it seems very useful, because the subscript of the array is 0, 1, 2 ......, it cannot be a negative number.
The following is a demonstration of this trap:
Source: http://blog.csdn.net/classfactory/archive/2004/08/29/87749.aspx
The enumeration type in C ++ inherits from the C language. Just like many other features inherited from the C language, the C ++ enumeration also has disadvantages. The most
Header file . It is best not to use fstream. h. when I was writing a program, I found that the latter would produce unsatisfactory output. The specific reason is unclear, probably due to the C ++ standard problem.
Solution1:
E. G.1
Char STR
/*************************************** **************************************** * ************** // Experiment 2: sorting Algorithm/* 1. enter 2-10 non-zero positive integers. If the input is 0, the input ends. /* 2. Number selection sorting
// Chain-based class # include # include using namespace STD; // node class, which defines the storage type and pointer name of each node. template class chainnode {public: t data; chainnode * link;}; // linked list class, which encapsulates the
/*************************************** **************************************** * ***** // * Experiment 04: stack application/* 1. enter a mathematical expression (assuming that the expression input format is valid), calculate the expression
// The chain table describes the creation and traversal of Binary Trees # include using namespace STD; /********************************* // is the definition of a queue Data Structure * // * the introduction of a queue is to achieve layer-by-layer
# Include using namespace STD; const int maxsize = 20; // The maximum size of the array int P; // a temporary number is used to mark the position of the array in the current operation char midorder [maxsize]; // used to store the char preorder
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